Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5949587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:16:16+00:00 2026-05-22T17:16:16+00:00

I am trying to get my site feed working. I need to select some

  • 0

I am trying to get my site feed working.

I need to select some content and display in my feed. After selecting, i strip tags then display.

The problem is this:

The data still displays as if the tags still exist (but no visible html tag) eg. after stripping, in my source ill have:

Hello (just illustrating)

—-There will be gap in between as if html character still exist, but cant see any when i view my source—–

Hi

How can i fix this . Thanks

EDIT:

To make it clearer, after stripping i still get text like this:

This is my first line

This is my second line with a gap in between the first line and second line as if there is a paragraph tag

UPDATE

i am using this:

$body=substr(strip_tags(preg_replace(‘/\n{2,}/’,”\n”,$row[“post_content”])),0,150);

when i echo $body, it still maintains new lines

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:16:16+00:00Added an answer on May 22, 2026 at 5:16 pm

    you may have a \n which was at the end of the paragraphs after the closing tags you stripped.

    preg_replace('/[\p{Z}\s]{2,}/s',' ',$string); 
    

    will strip out all white space, tabs, new lines and double spaces and replace with single space.

    \s Matches any white-space character. Equivalent to the Unicode character categories [\f\n\r\t\v\x85\p{Z}]. If ECMAScript-compliant behavior is specified with the ECMAScript option, \s is equivalent to [ \f\n\r\t\v].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Overview I am trying to get a photo feed on to my site using
I'm trying to get a PHP site working in IIS on Windows Server with
I'm trying to get a simple search form working in my RoR site. I've
I am trying to get a json feed working for the jquery Full Calendar
I'm having an issue trying to get a Facebook feed dialogue fb.ui to display
I'm trying to get content from external feeds on my Django web site with
Trying to get a section on my site working when it basically acts in
I'm trying to get a site to validate as HTML5 on the W3C Markup
I'm trying to get the footer in my site to look like this: Wilgrove
I am trying to get put out a simple site, which would pool the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.