Basic String Manipulation

Monday, August 11, 2008


$lotno = "NF218807-16"; //NF218807-16
$ext = substr(strrchr($lotno, "-"), 1); //16
$addzero = sprintf("%03d",$ext); //016
$lotdpn = substr($lotno, 0, strpos($lotno, "-")); //NF218807

0 comments: