![]() |
external data into a text file
ok, so dont ask why, just trying something....
I am wanting to put that actual data into a text file and using fwrite to go to the end and add the data in. But I seem to not be able to get the data into an array. array.txt Code:
'1'=>arrayCode:
<?phpI cant seem to get it to work and I cant find anything online. Jordan |
found it out, its a little different, but it works:
Code:
//initializes the array |
I'm quite unsure of what you're asking, but have you tried the
serialize and unserialize functions? If you're also asking how to read and write, I think I have covered everything you may need to know in the code below.php Code:
|
I know how to edit the file and add stuff to it, I just need a way to populate an array from another file....
|
Serialize and unserialize will do that all for you. |
ill try to explain better....
i have a register form, they put in all their info and then php processes it and then uses fopen() and fwrite() it will add their information into a text file (using a text file it would be easier to edit becuase i would need a ); at the end that fwrite() cant edit before that) and then use php to make a new array of $users [$users=array();] and then populate the array with a text document, so i would want it to. i can populate the array using php by using php Code:
index.phpso if i used: Code:
'1'=>arrayhope that helps explain my situation |
Can't you call the two $users variables something different to avoid confusion? Sounds like php is struggling to distinguish which var you're trying to count.
|
Quote:
|
| All times are GMT. The time now is 10:53 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0