Hi first of all merry christmas everyone... have a good one...
Basically, i want to know how i can delete text between 2 points.
e.g
[point] i want do delete this text and tags [/point]
Any ideas?
Thanks 😃
Jonathan
Try...
$string = 'asdfasdf[tag]hahahaha[/tag]asdfasdff'; $string = preg_replace( '/\[tag\]((.|\s)*?)\[\/tag\]/i', '', $string );
Thanks for your reply.
seems to only erase the [tag]s, not the [/tags] nor the text between 🙁
Works for me. What did you try?
What do you mean? This works perfectly.
yah it works...
now only if could understand all that crap inside the ( ) so i can use it for my own code..
can you brake it down for me ? '/[tag]((.|\s)*?)[\/tag]/i', all them /'s and \'s get my head lost.
thanks
Originally posted by zapa now only if could understand all that crap inside the ( ) so i can use it for my own code..
That doesn't sound very jolly...
Google is your friend 😉
http://www.zend.com/zend/tut/tutorial-delin2.php http://www.regular-expressions.info/php.html http://www.php.net/manual/en/ref.pcre.php http://www.phpfreaks.com/tutorials/52/0.php http://www.phpfreaks.com/tutorials/63/0.php http://www.phpbuilder.com/board/showthread.php?threadid=10223623
HTH 🙂
ok it works for me now :p
Thanks guys!!!