PHP Switch Case with Include Breaks Following Code -
my code working before included in external file.
in main file:
switch($data){ case 'test': include_once(dirname(__file__) . '/test.php'); break; }
in test.php:
<?php echo 'bark bark'; ?>
what when try load main file :
parse error: syntax error, unexpected 'break' (t_break) in /(......directory info removed)/mainfile.php on line 3
i have tried many different ways reference directory path, including full path (public_html, etc), , nothing seems load it. using wordpress; not sure if makes difference.
any ideas?
there character 
- 'zero width no-break space'
after ;
in include_once
. should have copy pasted somewhere. remove last character or try typing manually. fixes!
read here
Comments
Post a Comment