-1

I keeping getting the error:

Parse error: syntax error, unexpected ',' on line 97

Line 97:

if (preg_match('/['.unichr(0x1F300).'-'.unichr(0x1F5FF).unichr(0xE000).'-'.unichr(0xF8FF).']/u'), $_POST['username'])) {

How do I fix this?

PHP Web Dev 101
  • 535
  • 2
  • 9
  • 21

1 Answers1

3
if (preg_match('/['.unichr(0x1F300).'-'.unichr(0x1F5FF).unichr(0xE000).'-'.unichr(0xF8FF).']/u', $_POST['username'])) {

Remove the ) right before the ,

It might be easier to spot this way:

 $pattern = '/['.unichr(0x1F300).'-'.unichr(0x1F5FF).
            unichr(0xE000).'-'.unichr(0xF8FF).']/u';
 if (preg_match($pattern, $_POST['username'])) {

A good reason to keep your lines short, and use a good IDE.

Jessica
  • 7,075
  • 28
  • 39