preg replace - php preg_replace working only if there's ending space in string -
i have pattern:
preg_replace_callback('#@abc\((.*?)\)(.*?)@end.#is', .. my template string:
$test = "@abc('test')<h1>test</h1>@end"; // not working $test2 = "@abc('test')<h1>test</h1>@end "; // working why doesn't work if there's no space after @end?
as @rizier123 pointed out, correct regex:
preg_replace_callback('#@abc\((.*?)\)(.*?)@end#is', ..
Comments
Post a Comment