Se passi solo un numero č ovvio che ti restituisca solo le cifre:
Codice PHP:
$stringa = "123stringablabla";
$pattern = '/^(\\d+)(.*)$/';
preg_match($pattern,$stringa,$mth);
print_r($mth);
Se passi solo un numero č ovvio che ti restituisca solo le cifre:
Codice PHP:
$stringa = "123stringablabla";
$pattern = '/^(\\d+)(.*)$/';
preg_match($pattern,$stringa,$mth);
print_r($mth);
dA .. foto di viaggio
L'esperienza č il tipo di insegnante pių difficile.
Prima ti fa l'esame, e poi ti spiega la lezione.
Codice PHP:
$stringa2 = "123blablabla";
$pattern = '/^(\d+)(.*)$/';
preg_match($pattern,$stringa2,$mth);
echo"$mth";
risultato
codice:array
![]()
![]()
![]()
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made
$stringa = "123stringablabla";
preg_match("/^([0-9])?([a-z])*/i",$stringa,$match);
echo $match[0];
echo $match[1];
echo $match[2];
Originariamente inviato da Luca1984
$stringa = "123stringablabla";
preg_match("/^([0-9])?([a-z])*/i",$stringa,$match);
echo $match[0];
echo $match[1];
echo $match[2];
risultato
codice:11
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made