In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "how to remove leading 0 from php". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn this article "how to remove leading 0 from php".
Php method to remove the leading 0: 1, create a PHP sample file; 2, use the "ltrim ($str,'0');" method to remove the "0" on the left side of the string.
This article operating environment: windows7 system, PHP7.1 version, Dell G3 computer.
How does php get rid of leading 0?
It's very easy to get rid of the leading zero, as long as the ltrim function.
To remove leading 0, just use the following code:
$str = ltrim ($str,'0')
The ltrim () function removes white space characters or other predefined characters on the left side of the string.
Parameters:
String is required. Specifies the string to check.
Charlist is optional. Specifies which characters are removed from the string. If this parameter is omitted, all the following characters are removed:
"\ 0"-NULL
"\ t"-Tab character
"\ n"-Line break
"\ x0B"-Vertical Tab
"\ r"-enter
""-Spac
The above is all the contents of the article "how to get rid of leading 0 in php". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.