|
-
[RESOLVED] PHP IF Variable Contains...
How Can I Set Up An If Statement To Check If A Variable Contains These Characters? I Have The Character Filter On JavaScript Figured Out But i Want Both checking it.
Thank, You!!!
-
do you mean Variable value?
if so use preg_match
PHP Code:
preg_match('/[\'\/~`\!@#\$%\^&\*\(\)_\-\+=\{\}\[\]\|;:"\<\>,\.\?\\\]/', $haystack)
Natdrip :P
"water go down the hole" - plucky duck
-
 Originally Posted by iGeekiHackiMatt
How Can I Set Up An If Statement To Check If A Variable Contains These Characters? I Have The Character Filter On JavaScript Figured Out But i Want Both checking it.
Thank, You!!!
If you have a regex you are using in Javascript you can use preg_match in PHP with the same string.
-
Thank You!!!
 Originally Posted by Natdrip
do you mean Variable value?
if so use preg_match
PHP Code:
preg_match('/[\'\/~`\!@#\$%\^&\*\(\)_\-\+=\{\}\[\]\|;:"\<\>,\.\?\\\]/', $haystack)
I Got That To Work Awesomely, Thank You So Much
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks