php - How to get this output inside loop? -


this code

<?php $target = "http://www.example.com/"; $p="&p="; $page=5; for($yy=2; $yy<=$page; $yy++){         $link=$target.$p.$yy;             echo $link."\r\n"; } ?> 

output

http://www.example.com/&p=2  http://www.example.com/&p=3  http://www.example.com/&p=4  http://www.example.com/&p=5 

i biginner in php ,i don't know how output inside loop?

http://www.example.com/ http://www.example.com/&p=2  http://www.example.com/&p=3  http://www.example.com/&p=4  http://www.example.com/&p=5 

is want?

<?php $target = "http://www.example.com/"; $p="&p="; $page=5;  for($yy=1; $yy<=$page; $yy++){    if ($yy == 1) $link = $target;    else $link = $target.$p.$yy;     echo $link."\r\n"; } ?> 

Comments