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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:05:15+00:00 2026-06-12T22:05:15+00:00

I am Parsing a web page for getting the web page prize. the prize

  • 0

I am Parsing a web page for getting the web page prize. the prize include a Rupee symbol (₹).

So i used preg_replace to extract digits.

For example:

$str='₹ 1,195 ';
echo preg_replace("/[^0-9]/", '', $str);

Output is :

2091195

I tried same code to execute on http://writecodeonline.com/php/.

There i m getting correct output 1195.

I’m not getting what is the problem.

Thanks in Advance

  • 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-12T22:05:16+00:00Added an answer on June 12, 2026 at 10:05 pm

    If the unicode string is UTF-8, you can use the u (PCRE_UTF8) modifierDocs to tell preg_replace that it should use UTF-8 mode. If not, re-encode it to UTF-8 first and then use the modifier.

    Example (Demo):

    $subject = '₹ 1,195 ';
    $pattern = "/[^0-9]/u";
    $result  = preg_replace($pattern, '', $subject);
    
    echo $result;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to extract an information from the following web page with Python 3:
I have web page which is passing a querystring parameter to page 2: <a
I'm currently passing some date-time info to a web page using url parameters, which
A web app I'm working on requires frequent parsing of diverse web resources (HTML,
I am into a project where I deal with parsing HTML of web pages.
I tried accessing web for xml parsing using the code below: System.Uri proxy =
I am building a web service that involves parsing of 3rd party RSS feeds.
Is there a way to test a Web Service using VS2010 like it's used
I have an asp web form which is used for database entry located at
I need to retrieve some data from a web page. After analysing the HTML

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.