php - Make array from array values and save it to a file -


i working on project in array. when use print_r($arr) looks this:

array (      [0] => games,     [1] => wallpapers,     ..... ) 

what want want it's value in array array('games','wallpapers') , save file called data.txt using file_put_contents. did once myown using implode() gets error. there way?

you need serialize , save file. can comma-separated values using implode(), or json string using json_encode() or using serialize(). 3 of links have excellent documentation , examples.

if still have troubles, please edit question more specific details , code you've worked on far.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -