Page 1 of 4

Just tinkering

Posted: Tue Apr 30, 2013 7:05 pm
by Kawa
Just tinkering...

Posted: Tue Apr 30, 2013 7:06 pm
by indigolemon
With what? :o

Posted: Tue Apr 30, 2013 7:08 pm
by Donald
His tinkle.

Posted: Tue Apr 30, 2013 7:08 pm
by nitin_s1
I felt it. :oops:

Posted: Tue Apr 30, 2013 7:09 pm
by Kawa
lude profiles :D

Posted: Tue Apr 30, 2013 9:07 pm
by Kawa
@indigolemon - King of preg_match :)

Need to extract everything between the first occurrence of an [img]and[/img] from a string please :D

Posted: Tue Apr 30, 2013 9:10 pm
by indigolemon
Hokey, leave it with me - will have a play :)

Posted: Tue Apr 30, 2013 9:11 pm
by Kawa
coolio

Posted: Tue Apr 30, 2013 9:15 pm
by indigolemon
How's this? Assumed $content for post content (not all my own work btw)

Code: Select all

if (preg_match('/^.*\[img\](.+?)\[\/img\]/i', $content, $matches)) {
    echo $matches[1];
} 

Posted: Tue Apr 30, 2013 9:45 pm
by NafemanNathan
Yeah that looks about right.

WTF?!