[pioneer] Posted April 18, 2003 Share Posted April 18, 2003 ok, this is my problem. In the $file i have only one line and that it : something.txt|something.php|nokia|nokia7210|siemens-SL45|nokia5110|nokia9010i $fp = file($file); $text = explode( '|', $fp[0] ); $fp = fopen($file, "r"); $content = fread ($fp, filesize ($file)); fclose ($fp); $name = "pioneer"; $new = str_replace($text[2], $name, $content); Now when i use this code above, it replaces everything with the name "nokia" to pioneer. All i want it to do, is just to replace the $text[2] text to $name. Not every "nokia" word.. something.txt|something.php|pioneer|pioneer7210|siemens-SL45|pioneer5110|pioneer9010i plz help. Tnx in advance Link to comment Share on other sites More sharing options...
0 psyc Posted April 18, 2003 Share Posted April 18, 2003 $new = $text; $new['2'] = $name; $new = implode('|', $new); Are you trying to replace it in the file? Link to comment Share on other sites More sharing options...
0 [pioneer] Posted April 18, 2003 Author Share Posted April 18, 2003 Yes, I am trying to replace it in the file.. tnx for your help, going to try it now. Link to comment Share on other sites More sharing options...
Question
[pioneer]
ok, this is my problem.
In the $file i have only one line and that it :
Now when i use this code above, it replaces everything with the name "nokia" to pioneer.
All i want it to do, is just to replace the $text[2] text to $name.
Not every "nokia" word..
plz help. Tnx in advance
Link to comment
Share on other sites
2 answers to this question
Recommended Posts