Jump to content
houssam_ballout

string manipultation

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...