Jump to content

[SOLVED] call me dumb but can someone please help me out with this


kannu

Recommended Posts

hello,

after you read the question you would realize i am a true newbie in php, but what can i do now. i have to start somewhere.

 

my questions is that i am trying to create a simple "if then else" statement where i am trying to see if a string contains a set of letters. but i cannot find any function which can let me search if a string has those letters and continue in the if else statement.

for example :-

 

$wert = "catid52product34show"

 

 

if($wert == "product34")

{ do this }

else if($wert == "product35")

{ do that}

 

 

how can i search for "product34" within the variable $wert. and then proceed according on if then else statement

 

if someone can please help me out, i would really appreciate the same

 

thanks

 

 

Link to comment
Share on other sites

hey guys,

thanks to all of you for your reply and responses. specially to "iwannabeleet" i used the preg_match that she recommended and it works beautifully.

i have a database installed and it works. i just need to make a small change and i could not figure out, so i wanted to use the above function. thanks again to all of you for taking time to reply to my query. i really appreciate the same.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.