skip to main | skip to sidebar

divyのsh karelia

Remove Leading Zeros Using PHP

Posted by Divyのsh Karelia at 10:28 PM
It is actually two way to remove unnecessary Zeros

(1) ltrim()

Example : echo ltrim(”001″,”0″);
Result : 1

(2) intval()

Example : echo intval(”001″);
Result : 1
Wednesday, August 26, 2009
Labels: PHP

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Tags

  • .module
  • coloring syntax
  • drupal
  • Eclipse
  • javascript
  • jQuery
  • Magento
  • MySQL
  • Pear
  • PHP
  • PHP OpenSource MySQL
  • vps

Archive

  • ►  2010 (17)
    • ►  September (1)
    • ►  August (1)
    • ►  July (7)
    • ►  June (3)
    • ►  March (1)
    • ►  February (2)
    • ►  January (2)
  • ▼  2009 (16)
    • ►  December (1)
    • ►  November (1)
    • ►  September (2)
    • ▼  August (2)
      • Remove Leading Zeros Using PHP
      • Conversion of MySQL Timestamp and DateTime to Unix...
    • ►  July (2)
    • ►  April (4)
    • ►  March (2)
    • ►  January (2)
  • ►  2008 (4)
    • ►  December (1)
    • ►  November (3)