I am working on a project. However, I feel confused when i am trying to locate a variable from a text using preg_replace
Code: Select all
$text = preg_replace('/\$([\w\s\[\]\'\"]+)/', '\1<?php echo\$\2;?>', $text);But when i try using some array, it miss. I think the problem is [\w\s\[\]\'\"] but I don't know what is the mistake