waverider303 Posted January 6, 2010 Share Posted January 6, 2010 I have a database of of blog posts and I want to display only a handful of characters from the post. I know of substr and all those but is there a way to have it ignore html code. MY content in the database includes <p> and <span> tags. I dont want substr to count those as characters so that it wont cut out some of my code. Link to comment https://forums.phpfreaks.com/topic/187374-substr-but-ignoring-html-code/ Share on other sites More sharing options...
vinpkl Posted January 6, 2010 Share Posted January 6, 2010 you can strip those tags http://php.net/manual/en/function.strip-tags.php or you want to have those tags inside your content but dont want to count them. vineet Link to comment https://forums.phpfreaks.com/topic/187374-substr-but-ignoring-html-code/#findComment-989433 Share on other sites More sharing options...
waverider303 Posted January 6, 2010 Author Share Posted January 6, 2010 I want to include them but do not want them to count. Link to comment https://forums.phpfreaks.com/topic/187374-substr-but-ignoring-html-code/#findComment-989770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.