Hey guys,
I'm stuck on a little project I'm working on.
Basically, I need to save my $variable to a text file, but I don't have much knowledge.
So far I've got this;
But instead of writing "7" like it should, I'm getting "b:0;"
I'd also like to confirm that the value of $variable is indeed 7. How can I echo it to screen??
I've tried "echo $variable" but that does nothing.
(I'm running xp with wamp installed and I'm running my php script from a command prompt)
Any ideas??
Cheers
I'm stuck on a little project I'm working on.
Basically, I need to save my $variable to a text file, but I don't have much knowledge.
So far I've got this;
Code:
$stuff_to_store = serialize($my_varaible);
$handle = fopen('file.txt','w+');
fwrite($handle, $stuff_to_store);
But instead of writing "7" like it should, I'm getting "b:0;"
I'd also like to confirm that the value of $variable is indeed 7. How can I echo it to screen??
I've tried "echo $variable" but that does nothing.
(I'm running xp with wamp installed and I'm running my php script from a command prompt)
Any ideas??
Cheers