How can I change a value in an array?

[PHP]=>how to use serialize function to change only one value in file?

  • $vars = array( 'a' => 'aaaaa', 'b' => 'bbbbb', 'd' => 'xxxxx', ); file_put_contents('txtfile.txt',serial… so what script i should use to change only one value in file???

  • Answer:

    // put in file file_put_contents( 'file.txt', serialize( $vars ) ); //read from file $vars = unserialize( file_get_contents( 'file.txt' ) ); ;)

Hollo at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.