My code was working before I included it in an external file.
In my main file:
switch($data){
case 'test': include_once(dirname(__FILE__) . '/test.php');
break;
}
In test.php:
<?php
echo 'bark bark';
?>
What I get when I try to load the 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 to reference the directory path, including the full path (public_html, etc), and nothing seems to load it. I am using Wordpress; not sure if that makes a difference.
Any ideas?
There is a character

-'ZERO WIDTH NO-BREAK SPACE'
after your;
ininclude_once
. You should have copy pasted from somewhere. Just remove the last character or try typing manually. This fixes!Read about this here