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 &#65279 - 'zero width no-break space' after ; in include_once. should have copy pasted somewhere. remove last character or try typing manually. fixes!

enter image description here

read here


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -