|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
replacing one item in an array
I need help editting one line in an file acting as an array. I have a file that is a few arrays of links, looks a little like this
$webarray[]="http://www.php.net"; $webarray[]="http://www.cooltext.com"; $generalarray[]="http://amazon.com"; $miscarray[]="http://poo.net"; $webarray[]="http://www.htmlgoodies.com"; I want to edit the file via a web interface, but I can't find a way to read the file, make it editable through some logical interface, and then return just portion I want to edit to the correct spot (or even the entire file with my changes incorporated.) I've tried fwrite...but can't get the formula down. L'il help anyone? Here's what I'm working with so far...it's dirty and I'd prefer to just scrap it... php Code:
I know this is a mess...anyone know how I edit just one item in the array? Adam |
|
#2
|
|||
|
|||
|
RE: replacing one item in an array
hmmm...wonder why it posted as anonymous? I wonder if it's a Mozilla/cookie bug. IE is getting to be crap, and Mozilla sure is getting slick!
Adam |
|
#3
|
|||
|
|||
|
RE: replacing one item in an array
Couldn't you use a serialized array, write it into a flat file, and when you call it up somewhere to use it simply unserialize() it?
|
|
#4
|
|||
|
|||
|
RE: replacing one item in an array
I've looked all over, but I don't know how to use serialize() to do this. I thought serialize was mostly for storing array data in MySQL tables. This array is in a text file, and I need to modify just one item.
|
|
#5
|
|||
|
|||
|
RE: replacing one item in an array
I think there's a tutorial about sthg like what you want to do:
http://codewalkers.com/tutorials.php |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > replacing one item in an array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|