Jump to content

How to Find a Character in a Variable


NoMansLand

Recommended Posts

Hello,

 

I am trying to find a character in my DB's.

 

The DB has the data setup with +(number) & -(number)

 

I want to try and find a way for PHP to seperate them into two so each one has the seperate colour's.

 

i have tried preg_match, strstr & strpos but none of them seem to work.

 

Can you as PHP Genius's help out?

 

EDIT:

 

Please Do Not Worry, I have fixed this.

 

For people who were wondering:

 

$new_variable = strstr($variable_to_check, "+");

if($new_variable == "") {

do one you want

} else {

do what you want.

}

 

Thanks PHP Freaks :)

 

Thanks,

 

NoMansLand

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.