Jump to content

[SOLVED] Strange Problem - Should be a Simple Solution


JSHINER

Recommended Posts

<?php 
$num_pages = 4;

for ($p=1; $p<=$num_pages; $p++) {
$pages[] = '<a href="?p=' . $p . '">' . $p . '</a>';
echo join(' | ', $pages);
}
?> 

 

For some reason the above code is outputting "11 | 21 | 2 | 31 | 2 | 3 | 4" instead of "1 | 2 | 3 | 4"

 

Any ideas why?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.