How to remove the following 0

Source: Internet
Author: User
How can we achieve this by removing the following 010000000000 to 1010020000000 to 102010020030000 ?, Echopreg_replace ('/0 + $/', '0', 10020030000); the last time you added it, you need to remove it this time.... how can I remove the following 0 if there is no pid in the table?
10000000000 to 10
10020000000 to 1020
10020030000 to 102030


How can this be achieved?

------ Solution --------------------
Echo preg_replace ('/0 + $/', '0', 10020030000 );
------ Solution --------------------
The last time you add it, you need to remove it this time...
------ Solution --------------------
Does the table have a pid field? It is much easier to query the parent class pid = 0.
------ Solution --------------------
Extract a non-zero number from the regular expression and assemble it into two digits...

Discussion
10000000000 to 10
10020000000 to 1020
10020030000 to 102030


How can this be achieved?

------ Solution --------------------
Discussion
Just now I added a pid and finally got the reference:

------ Solution --------------------
"As mentioned above, I used the like ring query "?
------ Solution --------------------
Discussion

Just now I added a pid and finally got the reference:

Extract a non-zero number from the regular expression and assemble it into two digits...

Reference:
10000000000 to 10
10020000000 to 1020
10020030000 to 102030


How can this be achieved?

------ Solution --------------------
Echo preg_replace ('/0 +/', '0', 10020000000 );

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.