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 4618074
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:12:53+00:00 2026-05-22T02:12:53+00:00

We have mobile numbers stored in db in format 0789 121 928 We need

  • 0

We have mobile numbers stored in db in format 0789 121 928

We need to remove the blank spaces from the number so it is 0789121928

This is what I have used before to remove ‘,’ in $ fields, and am trying to modify.

<?php
$value1A = $row_person_select['mobile'];
$value1A = preg_replace("|,|","",$value1A); // Strips out commas in incoming value ie 2,340.00 > 2340.00
$totalA = $value1A;
echo $totalA; 
?>

I have tried the obvious of replacing the ‘,’ with ‘ ‘ but does not work?

Ideas? 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-05-22T02:12:54+00:00Added an answer on May 22, 2026 at 2:12 am

    You don’t need a regular expression here.

    $mobile = str_replace(" ", "", $row_person_select['mobile']);
    

    str_replace is sufficient if you just want to remove spaces.


    But just to answer the actual question, you can use "|\s|" with preg_replace to remove any whitespace characters.

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

Sidebar

Related Questions

OK i have two groups of mobile numbers (from mysql) which i need to
I have to read mobile numbers from the text file . I dont have
We have a large number of Window Mobile Devices (Symbol MC35 & MC70). I
I have array of mobile numbers, around 50,000. I'm trying to process and send
I have a mobile platform that I am trying to write some communications code
We have a mobile Application in a very unsteady WLan Environment. Sending Data to
I have a mobile site and I'd like to redirect users to the domain.mobi
I have a mobile app that is using LinqToDatasets to update/insert into a SQL
I have a mobile app webservice client that connects to a WCF webservice(on my
I have a mobile website special for the blackberry. I would like to create

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.