i have test class with one function , after including that i can use this class function with included pages but i cant use this function on included page's functions, for example:
testClass.php:
class test
{
public function alert_test( $message )
{
return $message;
}
}
including class: in this using class i dont have problem
text.php:
<?php
include 'testClass.php';
$t= new test;
echo alert_test('HELLO WORLD');
?>
but i cant use alert_test function with this method:
<?php
include 'testClass.php';
$t= new test;
function test1 ( $message )
{
echo alert_test('HELLO WORLD');
/*
OR
echo $t->alert_test('HELLO WORLD');
*/
}
?>
i want to use test class in sub-functions