|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Explode() Question
When I have an exploded string. How do I break this Array into lines so that may be read individually?
|
|
#2
|
|||
|
|||
|
RE: Explode() Question
Well, working with what you have posted, it looks like you have a newline character after each line that you would like as a seperate line. If that is always the case, you can use this:
$lines = explode("rn",$last_part); that will place each line into a seperate array element and you can then address them as such: |
|
#3
|
|||
|
|||
|
RE: Explode() Question
Darn... I see my mistake now.
I kept getting argument errors Awesome thanks again! |
|
#4
|
|||
|
|||
|
RE: Explode() Question
Does this break the lines up into a string or to another set of Arrays?
Well, at least the $lines are an Array... Can I then explode() the $lines in seperate Arrays? |
|
#5
|
|||||
|
|||||
|
RE: Explode() Question
That breaks $last_part down into an array called $lines which has each line in a seperate element. The end result would be as if you had done this:
php Code:
|
|
#6
|
|||
|
|||
|
RE: Explode() Question
The above is mine forgot to log in
|
|
#7
|
|||||
|
|||||
|
RE: Explode() Question
Now that I have the $lines Array.
Can I break up the Array again? php Code:
|
|
#8
|
|||
|
|||
|
RE: Explode() Question
Well, it appears that it is lined up by character count all the way. If this is the case for all your data, you can use substr()'s to get the data you want. I would have suggested just exploding it further but the amount of spaces in there makes that difficult. Actually what you could do is replace all sets of 5 spaces to 2 spaces. replace all sets of 4 spaces to 2 spaces, then replace all occurences of Z with Z plus a space. then explode with 2 spaces as your separator. If you want an example of that, let me know....
|
|
#9
|
|||
|
|||
|
RE: Explode() Question
An example would be great, just so I know how to apply it. Thanks
|
|
#10
|
|||||
|
|||||
|
RE: Explode() Question
Here you go, check this out...
php Code:
|
|
#11
|
|||
|
|||
|
RE: Explode() Question
Hmm... weird... I was using a FOR Statment but for some reason the first two Arrays were being exploded.
Eventhough, $i did return as Number(6). It only seemed to only count to Number(1). Thanks again, Matt. Now to apply this to "EVERYTHING!!!" hahahaha Ok I'm getting to much power from this... |
|
#12
|
|
|