Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-25-2010, 11:01 AM   PM User | #1
ramki067
New Coder

 
Join Date: Oct 2007
Posts: 90
Thanks: 2
Thanked 0 Times in 0 Posts
ramki067 is an unknown quantity at this point
How to search for a particular string using preg_match

Hi,

I've a string "mpeg4" stored in $value as below, which needs to be searched in if statement. But the below if is not searching! What is wrong in this?

if(preg_match('mpeg4\d)/i',$value))
$value = "MPEG-4";


Please help.


Thanks,
Ramki
ramki067 is offline   Reply With Quote
Old 11-25-2010, 11:28 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Use the simple strpos() or strstr() instead.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:19 PM.


Advertisement
Log in to turn off these ads.