Forum Moderators: coopster

Message Too Old, No Replies

newline problem

when array is displayed the newline is ignored

         

bobhoskins

10:26 am on May 18, 2005 (gmt 0)

10+ Year Member



Hi there,

I've used preg_match_all to put all links into the array. When i display them, i want each link on a new line but using the code below, each echo follows directly on from each other rather than on the next line.

i suspect i'm missing something bleeding obvious as usual - any ideas?

for ($i=0; $i< count($matches[0]); $i++) {

echo "Found link: " .$matches[0][$i]. " \n";

}

dcrombie

11:24 am on May 18, 2005 (gmt 0)



echo "Found link: matches[0][$i]<br>\n";

;)

bobhoskins

12:15 pm on May 18, 2005 (gmt 0)

10+ Year Member



Hi,

thanks for that,

i've tried that exact line and it only prints out -

Found link: matches[0][0]
Found link: matches[0][1]

rather than -

Found link: actual link

dcrombie

1:09 pm on May 18, 2005 (gmt 0)



Typo: use $matches instead of matches