parsing a string in a variable...

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

Post Reply
th3monk3y
Forum Commoner
Posts: 29
Joined: Thu Jun 19, 2003 10:34 pm

parsing a string in a variable...

Post 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
User avatar
doggy
Forum Commoner
Posts: 80
Joined: Tue Dec 09, 2003 5:01 am
Location: South Africa

Post 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
th3monk3y
Forum Commoner
Posts: 29
Joined: Thu Jun 19, 2003 10:34 pm

Post by th3monk3y »

thanks.. that did it!
-p
Post Reply