bilis_money Posted July 26, 2007 Share Posted July 26, 2007 Hi friends I have two contents the one looks like exactly below, orange banana papaya lemon grapes and the second text content is this one below, coconut now what i want is to add the second content into the first content in the very last row, so it will look like this below, consider also the original order, i know this is easy i hope you help me again. orange banana papaya lemon grapes coconut i just want to get the basic logic of the codes for this. thanks again in advance. Quote Link to comment Share on other sites More sharing options...
ss32 Posted July 26, 2007 Share Posted July 26, 2007 use square bracket notation, assuming it is an array... $fruits[] = "coconut"; Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 26, 2007 Share Posted July 26, 2007 what where is that data coming DB or what explain a bit more Quote Link to comment Share on other sites More sharing options...
bilis_money Posted July 26, 2007 Author Share Posted July 26, 2007 coming from a variable string. Quote Link to comment Share on other sites More sharing options...
Trium918 Posted July 26, 2007 Share Posted July 26, 2007 May be you should post some code, so that we can get a better view of what you are trying to do! Quote Link to comment Share on other sites More sharing options...
bilis_money Posted July 26, 2007 Author Share Posted July 26, 2007 ok here is the entire scenario the first content coming from a file.txt now that file is composed of ip addresses list. example: 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 what i'm going to do is to add the new ip address into this file. which should look like this below, which ever is convenient to you. 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 192.168.1.6 //new ip added. and must be save into file.txt again. i hope that's clear. thanks again in advance. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 26, 2007 Share Posted July 26, 2007 we add character this way $string .= 'test</br>'; $string .= 'teng'; now echoing $string we get test teng is that what you mean Quote Link to comment Share on other sites More sharing options...
Trium918 Posted July 26, 2007 Share Posted July 26, 2007 If you are writing to a text file, you must use the apend (a) mode. This would write the IP to the end of the file. You should really think about using a database to store IPs in. Quote Link to comment Share on other sites More sharing options...
bilis_money Posted July 26, 2007 Author Share Posted July 26, 2007 i'm tired of databases i want it simple, because it is simple Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 26, 2007 Share Posted July 26, 2007 i'm tired of databases i want it simple, because it is simple if thats simple then why do company use db and i guess it better to think which is better in performance maybe after learning a little bit with your issue you will know what im trying to say Quote Link to comment Share on other sites More sharing options...
Trium918 Posted July 26, 2007 Share Posted July 26, 2007 i'm tired of databases i want it simple, because it is simple apend (a) mode <?php $fp = fopen("file.txt", "a"); fwrite($fp, $input); fclose($fp); ?> Quote Link to comment Share on other sites More sharing options...
bilis_money Posted July 26, 2007 Author Share Posted July 26, 2007 Teng84 what is your website bro? i'm curious. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 26, 2007 Share Posted July 26, 2007 i dont have a site but we develop web site Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.