Page 1 of 1

parsing a string in a variable...

Posted: Sat May 22, 2004 12:30 am
by th3monk3y
I cannot seem to find how to parse a variable..

I have a var that passes a javascript function ...

$newtarget = "javascript:parentPass('$diritem')"; // actual code

This works fine, but I need to write some code that will look at the string and perform some logic

so if var $diritem = product

if instring("product") { // b.s. code :)
do this
} else {
do this
}

what would the proper php code be?
thanks,
-p

Posted: Sat May 22, 2004 12:48 am
by doggy
you mean in the url string/
that would be $product = $_GET['product '];
if ($product =="bla") {
do this
} else {
do that
}

Hope this helps

Posted: Sat May 22, 2004 1:16 am
by th3monk3y
thanks.. that did it!
-p