Turn text between tags into a variable
#1
How do I get the text between tags into a variable?

For example:

This is just [tag]a[/tag] test text!

I want to get: $variable = a;
Reply
#2
to use it in a function? do this:
//Open functions_post.php
//Find:
	$message = preg_replace("#\[email=(.*?)\](.*?)\[/email\]#i", "<a href=\"mailto:$1\">$2</a>", $message);
//After it, add:
	$message = preg_replace("#\[your_tag\](.*?)\[/your_tag\]#ei", "your_function(\"$1\")", $message);
$1 will be the text between the tags.
Reply
#3
Thanks a lot! Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)