how to acces 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

User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

accessing class variables

Post by kendall »

hey,

why did you put the $inValidFields = array();

if in the class object i did

return $this->$ErrorMSG;

and had a line in the foreach loop

a$= $inValidFields->checkFields($Field,$Value);

would this have worked?

i just need to get back the errors so that i can use them in the included file?
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Accessing class variables

Post by kendall »

Hey,

Y did he put $inValidFields = array();?

if i did $ErrorMSG = array();

and returned the $ErrorMSG;

and have $a=inValidFields->checkFields();

in the foreach statement

would i not get the same result?
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

I put that $inValidFields= array(); in my verison to make sure that the array was empty before starting the loop.

I hadn't noticed that your Field class uses ErrorMSG as an array already. I think you can do something like what you mention in your recent post, but there are a few logic errors that I think would have to be cleaned up.
Post Reply