Such as
<?php $explosion = explode(', ', $dataquery); $bomb = explode(' - ', $explosion); ?>
Would make my life easier if it does.
What are you actually trying to do?
I have data in a mysql that I keep an explode on like:
John - 19, Cathryn - 43, Joseph - 32
And I was wanting to separate age from name and bring in a equation requiring age.
Sounds like the problem isn't with manipulating the data but rather in storing it in the first place.
In other words, you should not be storing multiple values in a single field. Instead, you should normalize your DB. That would then make your current problem nonexistent.
Well I understand creating a new row in the structure is probably the best procedure which is why I saw this would make my life easier if this was possible
Beffic wrote:Well I understand creating a new row in the structure is probably the best procedure which is why I saw this would make my life easier if this was possible
So you're saying that normalising your database is impossible?
No, just saying it creates more work for me later.
Beffic wrote:No, just saying it creates more work for me later.
That is not necessarily true. For example, to modify your multi-valued field would require stuff like explode, searching, implode and then an update statement in SQL, whereas to update with a normalised database may require just an update statement in SQL.
to answer the question more directly, have a look at array_walk.