Jump to content

string manipultation


houssam_ballout

Recommended Posts

Hello,I had this case:Text is stored in mysql table in the means of html, i.e. it contains <p> ,<br /> .... I want to display it on a php page, I had 2 questions: I want to display the first 400 characters, then the second 300 each on different <div> , so I need to save them each on different variable? and what about html tags?Thanks

Link to comment
Share on other sites

You don't necessarily need to save each part in a different variable, if you're using string functions like substr then you can display a certain part of the string. You'll need to figure out how you want to handle HTML tags though, because you wouldn't want to break up the string in the middle of an element and you probably don't want to take the number of characters in the HTML tags into account. You'll need to think about how you want to handle that.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...