I am a PHP beginner and saw on the forum this PHP expression:
My PHP version is 5.2.X ()
$regex = <<<'END'
/
( [\x00-\x7F] # single-byte sequences 0xxxxxxx
| [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
| [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2
| [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3
)
| ( [\x80-\xBF] ) # invalid byte in range 10000000 - 10111111
| ( [\xC0-\xFF] ) # invalid byte in range 11000000 - 11111111
/x
END;
Is this code correct? What do these strange (for me) constructions like <<<
, 'END'
, /
, /x
, and END;
mean?
My PHP version does not support nowdoc, how should I replace this expression? without quotes 'END'
$regex became NULL
I recieve:
Parse error: syntax error, unexpected T_SL in /home/vhosts/mysite.com/public_html/mypage.php on line X
Thanks