Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Strip A String using explode (See related posts)

http://www.php.net/manual/en/function.explode.php

In this example, I need to strip the page's current URL to take off anything that follows a ? in that URL.

 
$fs_refer= $_SERVER ['REQUEST_URI'];

$fs_refer = explode("?", $fs_refer);
echo "$fs_refer[0] is now a URL without ?.
"; echo "$fs_refer[1] is the bit that used to follow the ?."; ?>

You need to create an account or log in to post comments to this site.


Related Posts