Zugzwangle Posted August 7, 2010 Share Posted August 7, 2010 im very new to regex - does: $aVal2 = str_replace('/\{\[/', "{", $aVal); $aVal3 = str_replace('/\]\}/', "}", $aVal2); find and replace "{[" and "]}" with { and } please help if you can!! Link to comment https://forums.phpfreaks.com/topic/210027-am-i-getting-my-regex-wrong/ Share on other sites More sharing options...
.josh Posted August 7, 2010 Share Posted August 7, 2010 str_replace is not regex. It matches and replaces the literal string. so you don't need delimiters or escapes. So you would do $aVal2 = str_replace('{[','{',$aVa1); Link to comment https://forums.phpfreaks.com/topic/210027-am-i-getting-my-regex-wrong/#findComment-1096158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.