web_master Posted January 5, 2009 Share Posted January 5, 2009 Hi, I got a text in dBase for example <b>12345abc</b> (this is sum 27 chars) this mean <b>12345abc</b> (this is 8 chars and <b></b>) How can I count from database to divide <b> and </b> (or other) from counting I know for $CharS = $request['text']; echo strlen($CharS); but this count all of chars. thnx Link to comment https://forums.phpfreaks.com/topic/139554-solved-count-characters-minus-some-characters/ Share on other sites More sharing options...
dennismonsewicz Posted January 5, 2009 Share Posted January 5, 2009 you could use this http://us.php.net/strip_tags Link to comment https://forums.phpfreaks.com/topic/139554-solved-count-characters-minus-some-characters/#findComment-730004 Share on other sites More sharing options...
Adam Posted January 5, 2009 Share Posted January 5, 2009 He'd need to convert them to HTML tags first, try: echo strlen(strip_tags(html_entity_decode($CharS))); A Link to comment https://forums.phpfreaks.com/topic/139554-solved-count-characters-minus-some-characters/#findComment-730007 Share on other sites More sharing options...
sloth456 Posted January 5, 2009 Share Posted January 5, 2009 maybe use str_replace to replace both sets of tags with blanks. Link to comment https://forums.phpfreaks.com/topic/139554-solved-count-characters-minus-some-characters/#findComment-730010 Share on other sites More sharing options...
web_master Posted January 5, 2009 Author Share Posted January 5, 2009 He'd need to convert them to HTML tags first, try: echo strlen(strip_tags(html_entity_decode($CharS))); A THIS WORK! Link to comment https://forums.phpfreaks.com/topic/139554-solved-count-characters-minus-some-characters/#findComment-730011 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.