Code:
- <?php
- class settings {
- var $cache_dir;
- function __construct($cache_dir = "C:\xampp\htdocs\site2\cache") (
- $this->cache_dir = $cache_dir;
- }
- }
- ?>
Theres my class heres the error i'm getting
Parse error: syntax error, unexpected '(', expecting ';' or '{' in C:\xampp\htdocs\site2\inc\settings.php on line 5
any ideas?
$this->cache_dir = $cache_dir;
$this->$cache_dir = $cache_dir;
isn't it?
I don't beleive so when your updating a variable in a class.
it's not, when calling a variable inside a class you don't need to include the $
Line 4 you put a ( at the end, instead of a {
Ok thanks Wrigthy
New problem when I eche cache_dir this is what it returns?
C mpp\htdocs\board2\cachesupport
when it should be
C:\xampp\htdocs\board2\cache
so the \is cancling out the x and the a but i dno't know whyt?
i just added a \ before the \xa