Page 1 of 1

Trim at position

Posted: Sun Feb 18, 2007 3:29 pm
by ianhull
Can anyone please hhelp me trim a string at a certain position

Thanks

Code: Select all


$thisServerLength = strlen($_SERVER['HTTP_HOST']);
trim($_SERVER['HTTP_REFERER']); //At Position $thisServerLength


Posted: Sun Feb 18, 2007 3:50 pm
by Chris Corbyn
You need a preg_replace(). Take a look in our regex forum.

Posted: Sun Feb 18, 2007 4:40 pm
by feyd
You actually appear to be looking for substr() ianhull. strpos() will likely be needed as well.