| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | php error It says unexpected t_variable or something - line 6 (highlighted) PHP Code: Thanks Tom
Last edited by SecondVersion; 05-15-2006 at 04:18 PM.
Reason: [COLOR] doesn't work in [PHP] ;)
|
| |
| | #2 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: presumably you meant to have:- PHP Code: PHP Code: |
| |
| | #4 (permalink) |
![]() Join Date: Jul 2005 Location: Coffs H, Australia
Posts: 3,456
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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.
__________________ Free Forums / GoDaddy Coupon Codes (NEW DOMAIN!) / Free Arcade Script / <?='Your computer is '.(1?fine:broken).'.'?> |
| |
| | THREAD STARTER #6 (permalink) |
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | http://us3.php.net/manual/en/function.str-ireplace.php Not case sensitive str_ireplace. webmonkey: scroll down first? |
| |