In message <[EMAIL PROTECTED]>, Nick
Jones <[EMAIL PROTECTED]> writes
>Hey list, I've got a PHP script that is supposed to parse through a block of
>text and converts all the web addresses in the block into clickable links.
>This
>is for a chat page I am creating for my family to use to keep in touch. When I
>try to run the file and post a new message on the page, I get:
>
>Parse error: syntax error, unexpected T_FOREACH in ..../w.php on line 68
>
>And here is the offending block of code on line 68 (line 44 in the attachment):
>
> foreach ($outarr as $val) {
> if(strpos($val,"http://") === 0){
> $val = '<a href="' . $val . '">' . $val . '</a>';
> }elseif(strpos($val,"ftp://") === 0){
> $val = '<a href="' . $val . '">' . $val . '</a>';
> }else{
> $val = $val;
> }
> }
>
>I'll attach the file to this email as a text file, maybe someone can spot the
>error and clue me in.
>
>Thanks!
>-Nick
$outarr = explode(" ",$chattext)
missing ';' !
--
Pete Clark
Sunny Andalucia
http://www.hotcosta.com/comm_1.htm
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/php-list/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/