I'm including PHP Class like thatrequire_once(realpath($_SERVER["DOCUMENT_ROOT"]).'\xampp\htdocs\aclass\classfile.php');
but when i executed the code thow a error
Warning: require_once(C:\xampp\htdocs\xampp\htdocs\aclass\classfile.php): failed to open stream: No such file or directory in C:\xampp\htdocs\aclass\index.php on line 2
Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs\xampp\htdocs\aclass\classfile.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\aclass\index.php on line 2
fileclass.php
<?php class Test{ public function hello(){ echo "hello every one"; } }
testclass.php
<?phprequire_once (realpath($_SERVER[“DOCUMENT_ROOT”]).‘\xampp\htdocs\aclass\classfile.php’);
$var=new Test();
$var->hello();
thank you in advance!!
#php