The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
preg_match help wanted
Hi all:
I have strings like PHP Code:
Thanks |
#2
|
|||
|
|||
Well I'm not a regex expert or anything but I thought I'd give it a shot:
PHP Code:
output is: Code:
Array ( [0] => [media=34]filename.jpg[/media] [1] => 34 [2] => filename.jpg ) |
#3
|
|||
|
|||
You are a confirmed genius, my friend. It works like a charm.
Thank you very much. --------------- Added [DATE]1260000667[/DATE] at [TIME]1260000667[/TIME] --------------- I am greedy and back for one more and hopefuly last Q for this project. My strings can be PHP Code:
PHP Code:
|
#4
|
|||
|
|||
Hmm...maybe:
Code:
if (strncasecmp("http:", $var, 5) == 0) { // This is a url } One thing I thought of that posting last night, it doesn't handle white space very well, it's possible to write a pattern that would ignore any white space on either end of the file name. (Or I guess you could also use trim() on the result if it were an issue). |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|