I am eager to ask a php question online. thank you!

Source: Internet
Author: User
I am eager to ask a php question online. thank you! Function number ($ str)
{
Preg_replace ('/\ D/S', '', $ str );

} Echo number ('text mosquito 38 ');

The extracted number $ asd = preg_replace ('/\ D/S', '', $ str); cannot be obtained.


Reply to discussion (solution)

Urgent request ~~~ Please help me.

Because your function does not return values.

Function number ($ str)
{
Return preg_replace ('/\ D/S', '', $ str );
}

Function number ($ str)
{
Return preg_replace ('/\ D/S', '', $ str );
}



Dear Moderator, how can I output the number 38 to $ asd = 38?

The function has no return value.

Function number ($ str)
{
Return preg_replace ('/\ D/S', '', $ str );
}

Dear Moderator, how can I output the number 38 to $ asd = 38? Is it the number after $ asd gets the output?

The function has no return value.



Can you perform the following operations? Return preg_replace ('/\ D/S', '', $ str); then I got a number, but how can I make $ asd = 38? Is it the number after $ asd gets the output?

Function number ($ str)
{
Return preg_replace ('/\ D/S', '', $ str );

}
$ Asd = number ('text mosquito 38 ');
Echo $ asd;

Function number ($ str)
{
Return preg_replace ('/\ D/S', '', $ str );

}
$ Asd = number ('text mosquito 38 ');
Echo $ asd;

Thank you !!!!!!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.