| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Soon to be RICHdoggie! | php error It says unexpected t_variable or something - line 6 (highlighted) PHP Code: Thanks Tom
__________________ █ Exchange your long URL for a much smaller one! █ Free Anonymizer/Proxy █ Taz Martin's blog - Learn all about internet marketing, promoting your website and much more! Last edited by SecondVersion; 05-15-2006 at 03:18 PM. Reason: [COLOR] doesn't work in [PHP] ;) |
| |
| | #2 (permalink) |
| Senior Member | PHP Code: presumably you meant to have:- PHP Code: PHP Code: |
| |
| | #4 (permalink) |
![]() | As Peter showed, the leaving out of the comma was the problem. But just a note, you should always try to optimize what you can in PHP to make things nice and quick, every little bit counts. So for the first line I'd suggest using str_replace rather than eregi_replace, as its quicker to process. So line 6 would be: $sub = str_replace($domain,"",$sub); All the best! Rhett.
__________________ <?php if(1===1){ $computer="fine."; }else{ $computer="broken."; } echo "Your computer is ".$computer; ?> |
| |
| | #6 (permalink) |
| Soon to be RICHdoggie! | Thanks a lot everyone, I can never figure it out, post it here, and then feel so stupid because it is sooooo obvious. Thanks for all your help though [QUOTE=BillyConniteSo line 6 would be: $sub = str_replace($domain,"",$sub); [/QUOTE] is str_replace() case dependant though? eregi_replace isn't which is why I use it. I suppose in this case I could use "strtolower" or something. Thanks Tom |
| |
| | #7 (permalink) |
| Buy my domains. | http://us3.php.net/manual/en/function.str-ireplace.php Not case sensitive str_ireplace. webmonkey: scroll down first? |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |