...

View Full Version : Start to end



Crisp
02-20-2010, 09:46 PM
Hey,
Do you know if there is a way I can do something like this:


[start]Hello world, hello world.[/end]

What I want, is where I can search for the text inside the start bracket, yet not outside the end bracket.
This would help me a ton in what I'm doing.

I'm not sure what function to use for it though.
Does anyone know how I can do this?
Thanks! :)

MattF
02-20-2010, 10:01 PM
$input = '[start]Hello world, hello world.[/end]';

preg_match_all('#\[start\](.+?)\[/end\]#', $input, $matches);

print($matches[1][0]);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum