Hi, I am unable to call a function in a php class which is in a different file. Here is the code for both the files. Any help will be appreciated…I am just trying to learn php…
HelloWorld.php
<?php class HelloWorld { function HelloWorld() { } function GetString() { return "HelloWorld"; } } ?>Calling php : test.php
<?php echo "Starting.."; $helloObj = new HelloWorld(); $rtr = $helloObj->GetString(); echo "Return from class" ; echo $rtr; ?>When i access test.php from the browser, it prints out “Starting…” but does not go beyond that…can anyone tell me why ?
I am using php 5
Thanks
Ashish