Welcome to Onlinetunes24 .....

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

This is default featured post 1 title

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

This is default featured post 2 title

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

This is default featured post 3 title

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

This is default featured post 4 title

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

Convert numbers into strings

Here is a simple function to convert numbers into strings like this:
0 => 0000
1 => 0001
20 => 0020
432 => 0432

<?php
 
function number_pad($number,$n) {
    return
str_pad((int) $number,$n,"0",STR_PAD_LEFT);
  }
?>
$n indicates how many characters you want.

// optional  $number = 0; for ($i=1; $i<=50; $i=$i+1){
    $number = $number+$i;
    echo str_pad($number, 5, "0", STR_PAD_LEFT) . '<br />' ;
}
?>

How to convert mysql date format to user define php date format.

User define PHP date format to MySQL date format.
echo 'Orginal = ' . $date = '06/03/2014';
echo ' To ' . $date = date("Y-m-d", strtotime($date)) .'<br />' ;

MySQL date format to User define PHP date format.
echo 'Orginal2 = ' . $date2 = '2014-03-06';
echo ' To ' . $date2 = date ('d-m-Y', strtotime($date2)) .'<br />' ;

Loading
Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Flying Twitter Bird Widget By ICT Sparkle