Jump to content

working with a text string


tjmbc

Recommended Posts

anyone know how I can put line breaks in a string every time there is a digit.

 

i have a mysql text field that has a string like this:

 

3/4 went to the store 12/4 went to the store 8/16 had a popsickle

 

i want to take that string and make it like this:

 

3/4 went to the store

12/4 went to the store

8/16 had a popsickle

 

any idea's?

Link to comment
https://forums.phpfreaks.com/topic/107744-working-with-a-text-string/
Share on other sites

/stumped

 

This is the best I have..

Is there any any way you can add a : between the entries? like when inserting them into the DB you could do $new = $old.":";, then insert new into the db. If you can, you can just use the explode function and add a <br> when parsing.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.