super that worked the charm. The only problem now is that it only replaces the text once kinda. Like I have this as my preg_replace code:
Code: Select all
$post['pagetext'] = preg_replace('#\[usersonly\](.*)\[/usersonly\]#is', '*You must be logged in to view this. Please [url="register.php"]open account[/url].*', $post['pagetext']);
and $post['pagetext'] is this:
asdfasdfasdfsafsadfasdf [usersonly]password[/usersonly]
[usersonly]
multiline stuff
[/usersonly]
and the only thing that comes out is this:
asdfasdfasdfsafsadfasdf *You must be logged in to view this. Please open account.*
(the open account is linked properly)
But I am missing the second replacement. Why?