Best Method for Detecting Query Strings

2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 19, 2014   (RSS)

By claire - November 19, 2014

Hey Perch

You'll need a function called strpos() that can detect if a string contains another string. The usage is as follows:

if(strpos($link, '?') !== false) {
    $link .= '&pic=4';
}
else {
    $link .= '?pic=4';
}

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/