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

  • Home
  • SEARCH
  • 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 8114123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:03:24+00:00 2026-06-06T03:03:24+00:00

I have bio information inside a variable: $bio = ‘text, text, text…’; I trim

  • 0

I have bio information inside a variable:

$bio = ‘text, text, text…’;

I trim that text and use rtrim php function at the end

trim($bio);
rtrim($bio,',.;:- _!$&#'); 

The problem is that sometimes the bio information has a structure like this:

$bio = 'hello, i am jason!and i like cars,sports,beer and boats, tv, papers.';

Is there a way to add spaces when two words separated by punctuation marks are not delimited by spaces? Like “i am jason!and” or “cars,sports,beer”

$bio should be:

$bio = 'hello, i am jason and i like cars, sports, beer and boats, tv, papers.';

Thank you!

  • 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-06-06T03:03:25+00:00Added an answer on June 6, 2026 at 3:03 am

    You could always have a loop that checks each index of the string, and if it equals one of the given punctuations you have, create a new string such as

    $bio = substr($bio,0,index of punctuation+1)." ".substr($bio,index of punctuation+1,length     of bio);
    

    It’s bulky for sure but should get the job done.

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

Sidebar

Related Questions

I have a Model that looks like: class MyModel(Model): name = models.TextField(blank=True, default='') bio
I have a couple strings that I'm synthesizing: .h @property(nonatomic,copy) NSString* bio; .m @synthesize
I have the following htaccess file: RewriteEngine On RewriteRule ^([^/]*)$ /bio.php?bio=$1 [L] I need
I have a legacy app(HTTP and raw TCP) that uses traditional BIO (blocking IO)
Maybe you guys can help: I have a variable called $bio with bio data.
I have a simple link in a menu <a id=Home href=Amico-Bio-Home-Page></a> to which i
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
Have a matrix report now that has Position, Hours and Wages for a location
I have done a couple research jobs in Bio-informatics and I have used Matlab

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.