PHP Get Start And End Of String When M Is Enabled, You Should Use \A And \Z, Like This: – String Function

 
preg_match("/\AThis/m", $multitest);
    // returns true if the string starts with "This" (true)    preg_match("/symbol\z/m", $multitest);
    // returns true if the string ends with "symbol" (false)

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.