Results 1 to 8 of 8
-
26th Apr 2011, 08:34 PM #1OPMemberWebsite's:
premium-links.net wanted-programs.comphp help regex!
i have to do a simple work
i have to find all <youtube>v=xxxxxx</youtube> in post of a wordpress
and replace then custom way!
Code:function the_content($more_link_text = null, $stripteaser = 0) { $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); preg_match_all('#<youtube>(.*?)</youtube>#i', $content, $link_matches); if (count($link_matches) > 0){ foreach ($link_matches as $link_value){ echo $link_value; } } return $content; }
pls help!?RaJ? Reviewed by ?RaJ? on . php help regex! i have to do a simple work i have to find all <youtube>v=xxxxxx</youtube> in post of a wordpress and replace then custom way! function the_content($more_link_text = null, $stripteaser = 0) { $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters('the_content', $content); Rating: 5
-
26th Apr 2011, 08:38 PM #2It begins...
Post the output of:
PHP Code:print_r($link_matches);
-
26th Apr 2011, 08:43 PM #3OPMemberWebsite's:
premium-links.net wanted-programs.com(
[0] => Array
(
[0] => <youtube>1</youtube> [1] => <youtube>100</youtube> [2] => <youtube>1000</youtube> [3] => <youtube>10000</youtube> [4] => <youtube>100000</youtube> [5] => <youtube>1000000</youtube> [6] => <youtube>10000000</youtube> [7] => <youtube>100000000</youtube> )
[1] => Array
(
[0] => 1
[1] => 100
[2] => 1000
[3] => 10000
[4] => 100000
[5] => 1000000
[6] => 10000000
[7] => 100000000
)
)
-
26th Apr 2011, 08:49 PM #4OPMemberWebsite's:
premium-links.net wanted-programs.comis there something wrong with regex?
-
26th Apr 2011, 08:51 PM #5MemberWebsite's:
ExploringPC.com DedicatedSeedboxHosting.comBro, I can't use regex, if you want, I can code it my way. Will use String Tokenizer.
-
26th Apr 2011, 09:00 PM #6OPMemberWebsite's:
premium-links.net wanted-programs.comfixed it guys sorry for the trouble
-
26th Apr 2011, 09:09 PM #7MemberWebsite's:
Tastro.org HDTVXviDLOL.com EpisodeSeasons.com FileBorg.org W-47.comchange this:
preg_match_all('#<youtube>(.*?)</youtube>#i', $content, $link_matches);
to this:
preg_match_all('#<youtube>(.*?)<\/youtube>#i', $content, $link_matches);
if it still won't work... then post the error which you get.LE with your pr2 site? <a href="http://tastro.org/">Tastro.org</a> or link exchance with our category page: <a href="http://tastro.org/i/hdtv">HDTV</a> | <a href="http://tastro.org/i/dvdrip">DVDRip</a> | <a href="http://tastro.org/i/r5">R5</a> | <a href="http://tastro.org/i/bdrip">BDRip</a> | <a href="http://tastro.org/i/brrip">BRRip</a>
-
26th Apr 2011, 09:22 PM #8MemberWebsite's:
ExploringPC.com DedicatedSeedboxHosting.comRaj solved it. Apparently he was stuck in a loop. Happens to all of us.
Best of luck with your project mate.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Regex in shell
By mahjong in forum Server ManagementReplies: 0Last Post: 8th Apr 2012, 08:58 AM -
Need help with RegEx
By dima1236 in forum Web Development AreaReplies: 7Last Post: 14th Jan 2012, 05:53 PM -
Need help with Regex - VB.NET
By Connor in forum Web Development AreaReplies: 2Last Post: 27th Sep 2011, 05:11 PM -
Help with Regex
By ChaoscripT in forum Web Development AreaReplies: 2Last Post: 15th Dec 2010, 09:26 PM -
need help with some regex
By t3od0r in forum Web Development AreaReplies: 1Last Post: 13th Aug 2010, 04:23 PM
themaCreator - create posts from...
Version 3.08 released. Open older version (or...