I'm trying to create an autoloader, so I can reference my PHP classes using namespaces that reflect a library folder structure.
I've used php.ini (on my host) to auto_prepend the file that contains the autoloader function, and my index has the folloing code in it:
Code: Select all
<?php
$object = new \lib\sql\functions();
echo ("Hellow World");
?>Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/findmyne/public_html/index.php on line 3
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/findmyne/public_html/index.php on line 3
Parse error: syntax error, unexpected T_STRING in /home/findmyne/public_html/index.php on line 3
Anyone any ideas where i'm going wrong?