<? $yurl=$row[yurl]; $yurl_name=$row[yurl_name]; $var=explode("|",$yurl); $var2=explode("|",$yurl_name); $z=0; foreach($var as $v){?> <a href="<?=$v?>"><?=$var2[$z++]?></a> <? } ?>