I have two foreach loops: 1st one:
foreach ($items as $key => $item)
{
$keywords = explode(\' \', $qsvarus);
$title[$key]
You can use the MultipleIterator for this:
$m = new MultipleIterator();
$m->attachIterator(new ArrayIterator($items), 'item');
$m->attachIterator(new ArrayIterator($linkai), 'linkas');
foreach ($m as $unit) {
// $unit['item'] contains an entry from $items
// $unit['linkas'] contains an entry from $linkai
// your logic here
}