PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ianhull
Forum Contributor
Posts: 310 Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK
Post
by ianhull » Sun Feb 18, 2007 3:29 pm
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
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Sun Feb 18, 2007 3:50 pm
You need a preg_replace(). Take a look in our regex forum.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Feb 18, 2007 4:40 pm
You actually appear to be looking for
substr() ianhull.
strpos() will likely be needed as well.