How to Array and search

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
baoky
Forum Newbie
Posts: 12
Joined: Sat May 24, 2008 6:21 am

How to Array and search

Post by baoky »

i wanna ask about , in my situation i have a big chunk of string, e string contain several video path such as http://domain.com/something.flv and http://domain.com/something.mp4 , i wanna grab all substring in e string($content) that start with http and end with either.flv or .mp4 , add them to array, and do a loop to call array index 0 to index n base on the array size.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: How to Array and search

Post by AbraCadaver »

Give an example of this string.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: How to Array and search

Post by RobertGonzalez »

There are lots of things you can do with this. You can use array_map, you can walk/loop the array or push the array into a match/replace function along with a callback function to do what you want.

What have you tried so far?
Post Reply