Search the Community
Showing results for tags 'implode explode list'.
-
Hi people, I'm still going through the long learning curve of understanding of PHP so please go easy on me! Right now I'm going through a course to help me on my way and i have recently gone through a lesson which briefly covered the 'implode" and 'explode' functions in regards to an array. Anyway, I have been thinking and was wondering if I could somehow use PHP to clear up some data for my own personal use. What i mean is, I have a list of data, lets say it looks like this: #John Smith 1.5.55.1.101 #Ben Chen 1.7.8.55.4.1 #Tim Roberts 155.587.5.5 #Terry Noble 9.44.47.7.6 #Harry Flint 9.5.44.10.7 ...And so on. Maybe about 100 entries in total. Is there a way i could write a php script that i can add this data to or that the script could fetch this data and then remove all the information except for the numbers at the bottom of each entry and then echo the result to my local host so it looks something like this: 1.5.55.1.101 1.7.8.55.4.1 155.587.5.5 9.44.47.7.6 9.5.44.10.7 This is really just an expirement, if it is possible I would love to know where to start, so i can start playing around with this. Again If it is possibe what i would like to do eventually is add a function that removes duplicates. The list of data is not on a database or anything, its just on a text file and I dont really wanna put it on a database. I guess i could add it to the top of my php script right as some kind of string? Or am i going off track? I hope some one can point me in the right direction, so I have something to work with and understand. Thanks in advance guy's and girls.