Welcome Guest, Not a member yet? Register   Sign In
How do you reset an object
#1

[eluser]floweringmind88[/eluser]
I loaded a class from my library. It works great but then the second time I call the object function it spits out the old data instead of the new data.

Is there a way to reset the class object?

Thanks!
Chris
#2

[eluser]stuffradio[/eluser]
Wouldn't you just use the unset($object); function?
#3

[eluser]Kromack[/eluser]
Do a new Object of your class ?
#4

[eluser]floweringmind88[/eluser]
The real problem was arrays were not being cleared in the class so the next time I used it the old data was spit out. So everything is great now.
#5

[eluser]nmweb[/eluser]
Code:
new ClassName;

After you do $this->load, the class file is included so you can always instantiate new classes of the kind afterwards.




Theme © iAndrew 2016 - Forum software by © MyBB