return list class variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
srdva59
Forum Commoner
Posts: 77
Joined: Sun Feb 15, 2009 10:58 am

return list class variables

Post by srdva59 »

hi,
i have created this class:

class mostest extends mosDBTable {

var $id=null;
var $id_cliente = null;
var $nome_cliente = null;
var $data = null;
var $hora = null;

now i want creat a function to check if all variables is created in a table.
for example i want return something like this: echo name_var[0] -> $id

i have found this on the net:
$object = new mostest($teste);
$var_teste = get_class_variables($object);
but i receive this error:

Call to undefined function: get_class_variables i using php 4
how can i return the variables list?
thanks a lot for your help
:)
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: return list class variables

Post by AbraCadaver »

Did you find get_class_variables() in the manual? Anyway, you need get_object_vars().
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply