Guys.... I have an idea to implement a new web solution to our company for that I need your help for some cording supports. Guys I have sentential number system like 888881,888882,888883...ect.I need to play with some logic algorithms to extract information from these numbers.I have explain a example below for your ease. let's take 888882 here first two digits says the stock number,second two digits says the year,third digit says the color,and last two digits are unique to the situation.Now I need to read the above number and extract those details from that number.For that I need to know a mechanism to check digits alone. I mean I need to read the above number and to check 1.First two digits to find the stock number 2.Second two digits to find the year 3.Third digit to find the color....etc I have these product numbers in a MySql database and I can get a number to a variable but don't know a way to brake the number to get those details I need your help for this guys. If you have a Idea or any tutorial for this situation please help me by posting it here. Thank you very much Waiting for helps.
$number = "888881"; echo "ID: " . $number . "<br><br>"; $stock = substr($number, 0, 2); $year = substr($number, 2, 2); $color = substr($number, 4, 1); $leftover = substr($number, 5, 1); echo "Stock: " . $stock . "<br>"; echo "Year: " . $year . "<br>"; echo "Color: " . $color . "<br>"; echo "Unique ID: " . $leftover . "<br>"; PHP: ID: 888881 Stock: 88 Year: 88 Color: 8 Unique ID: 1 Code (markup): Something like this ?
Of cause yes ActiveFrost that is what I exactly wanted. Thank you very much dude.You did a great work. Thank you again ActiveFrost