PHP strtok

The PHP function strtok splits a string one by one.

In the example below I’m trying to split off everything after the ? in the URL.

In PHP I was able to do this with the following:

$facebookURL = '';
$cocacolaURL = '';

$facebookURL = strtok($facebookURL, '?');
$cocacolaURL = strtok($cocacolaURL, '?');

Check out the demo here.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *