Page 1 of 1

Please help about array

Posted: Sat Mar 21, 2009 6:53 am
by mahfuzit
Hello I am learning php. I have a problem about array. I am trying to describe it.......

Suppose I have created the following array.
$internet = array("forum", "blog", "website");
I have not assigned the key and it will automatically be assigned. Now I want that the values of this array ("forum", "blog", "website") will be stored in a txt file. And if I add or delete on of these values in the txt file the $internet varriable will automatically change. Finally, I want to use the following code:
ksort ($internet);
I hope it is clear to you that what my problem is? :)

Re: Please help about array

Posted: Sat Mar 21, 2009 8:20 am
by php_east
these two functions would be sufficient for your purpose.
1. file_put_contents
2. file_get_contents