It is not possible.
You have to create a class containing that variable as member variable, and a member function to assign value to those variables.
Check the below code. I haven't tested it. In a nuttshell works somewhat like that.
<?php
/* Class Starts here */
class member{
var $name;
var $age;
function assignData($n,$a){
$this->name = $n;
$this->age = $a;
}
}
/* Class ends here */
//Here gets the post from some other page
$membername = $_POST['name'];
$memberage = $_POST['age'];
//Creates new object of member class defined above
$object = new member();
//Calls assignData function to assign variable values posted from previous page
$object->assignData($membername,$memberage);
//Prints the data
echo $object->name;
echo "<br>";
echo $object->age;
?>
Dec 8, 2009