This is a discussion on What is wrong with my script? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; <?php $lines = file('http://tibia.4players.de/statistics/?subtopic=whoisonline&world=Nova') ; $charname = $_POST['char_name']; for ($i=0; $...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
<?php
$lines = file('http://tibia.4players.de/statistics/?subtopic=whoisonline&world=Nova') ; $charname = $_POST['char_name']; for ($i=0; $i<count($lines);$i++) { if (stristr ($lines[$i], $charname)) { str_replace ($charname, "<span style="color:green;">"$charname"</span>"); } echo $lines[$i]; } ?> Parse error: parse error, unexpected T_STRING in c:\program\easyphp1-7\www\test\test1.php on line 8 What is wrong? Sincerely, Andreas Saarva. |
|
|||
|
Andreas Saarva wrote:
> <?php > $lines = > file('http://tibia.4players.de/statistics/?subtopic=whoisonline&world=Nova') > ; > > $charname = $_POST['char_name']; > > for ($i=0; $i<count($lines);$i++) { > if (stristr ($lines[$i], $charname)) { > str_replace ($charname, "<span > style="color:green;">"$charname"</span>"); } > echo $lines[$i]; > } > ?> > > Parse error: parse error, unexpected T_STRING in > c:\program\easyphp1-7\www\test\test1.php on line 8 > > > What is wrong? > > Sincerely, > Andreas Saarva. > > If you need to use double quotes within a double quotes string you need to escape them so... "<span style=\"color:green;\"...etc ~Cameron |