I have preg_replace function that I’m calling and putting on multiple lines for readability but the */ characters in the regex mess up the comments. How can I comment out all these lines without moving them all onto one line?
return preg_replace('/.*/',
'Lorem Ipsum' .
'More Lorem Ipsum'
,
$foo);
You could use a different regex pattern delimiter character:
EDIT:
The delimiter character is a feature of PCRE (Perl Compatible Regular Expresssion). No PHP configuration is needed to use a different delimiter.
Regexp Quote-Like Operators
Quote and Quote-like Operators
These are all valid:
Take a look at PHP’s documentation on PCRE Patterns to see a really good overview.