This is written in (you know what language)...
// check the string length
echo " The serial number is " . $NoSiri . " and the length is " . strlen($NoSiri) . " character ";
$rest = substr($NoSiri, 0, 1); // check the first character
echo $rest;
// jika 1st character = 0, buang
if ($rest == '0'){
$NewNoSiri = (ltrim($NoSiri,$rest));
echo " It's now " . strlen($NewNoSiri) . " character ";
echo $NewNoSiri; }
else
{echo "Wrong number";}
This portion of program I used to check on my db if the serial number of cards inserted in the db starts with '0'.
Please feel free to use it if you like it. I begin with simple thing - CEx team
Sunday, March 27, 2011
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment