[FLUG] Re: query mysql

Mailing List del Fortunae LUG
=============================

Simon wrote:

No però se $str è il "7" che hai tirato fuori puoi fare tipo:

if(strlen($str) == 1)
{
 $str = '0' . $str;
}

Ma c'era una funzione che faceva da sola il padding... wuh se la ricorda di
sicuro.

printf("%02s", $mesi[0]);

facendo cosi` risparmio ben 3 righe di codice :)

--
«Just in terms of allocation of time resources, religion is not very efficient. 
There's a lot more I could be doing on a Sunday morning.» Bill Gates

Other related posts: