Remove all html tags from php string

0 votes

I want to display the first 110 characters of a database entry. This worked fine with my code:

<?php echo substr($row_get_Business['business_description'],0,110) . "..."; ?>

But the above entry has HTML code in it that's been entered by the client. So it displays:

<p class="Body1"><strong><span style="text-decoration: underline;">Ref no:</span></strong> 30001<strong></stro...

I want to strip out all html code and display the first 110 characters in between < and >. How can I do this?

Jun 16, 2022 in PHP by narikkadan
• 63,420 points
623 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to remove all special characters from a string?

Hello @kartik, This should do what you're looking ...READ MORE

answered Sep 17, 2020 in PHP by Niroj
• 82,880 points
10,674 views
0 votes
1 answer

How to remove new lines and returns from php string?

Hello @kartik, You need to place the \n in double ...READ MORE

answered Nov 19, 2020 in PHP by Niroj
• 82,880 points
13,275 views
0 votes
1 answer

How to delete all files from a folder using PHP?

Hello @kartik, Use this: $files = glob('path/to/temp/*'); // get ...READ MORE

answered Sep 14, 2020 in PHP by Niroj
• 82,880 points
1,133 views
0 votes
1 answer

How to remove duplicate values from an array in PHP?

Hello @kartik, Use array_unique(): Example: $array = array(1, 2, 2, 3); $array ...READ MORE

answered Sep 15, 2020 in PHP by Niroj
• 82,880 points
2,525 views
0 votes
1 answer

How to import all classes from another namespace in PHP?

Hello @kartik, This is not possible in PHP. All ...READ MORE

answered Oct 20, 2020 in PHP by Niroj
• 82,880 points
4,679 views
0 votes
1 answer

How to remove a variable from a PHP session array?

Hello @kartik, Try: if (isset($_POST['remove'])) { ...READ MORE

answered Nov 8, 2020 in PHP by Niroj
• 82,880 points
4,382 views
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
1,200 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
10,974 views
0 votes
1 answer

Failure uploading Image on AmazonS3 with PHP SDK

Try this, I took it out from ...READ MORE

answered May 4, 2018 in AWS by Cloud gunner
• 4,670 points
3,773 views
0 votes
1 answer

Trying to call AWS API via PHP

Try using AWS SDK for PHP, Link ...READ MORE

answered Jun 6, 2018 in AWS by Cloud gunner
• 4,670 points
1,487 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP