Im very new to php and having problems with a project I'm working on. It is a vehicle VIN decoder. Everything works fine except for the engine code output. Here is the little chunk of code used for the script. Problem is that the $engineout variable never get's set ....in fact the switch statement doesn't even run the default.
The rest of the code follows the same structure of case "year" with an array. Any thoughts?
Oh yeah, the 5th character of the VIN is the motor code. 1st character is the year ($vinfy)
//ENGINE CODE IN CONSTRUCTION//
//set vin codes//
$vinfy = substr($vin,0,1);
switch ($vinfy) //set motors for 1965
{case "5": //1965 motors
$ecode65 = array("A","C","D","F","K","T","U");
$engine65 = array("289 4V","289 2V","289 4V 1964 1/2 only","289 4V HP","200 6cyl","170 6cyl 1964 1/2 only");
for ($x=0; $x<=7; $x++)
{
If (substr($vin,4,1) == $ecode[$x])
{$engineout = $engine65[$x]; }
}
break;
case "6": //1966 motors
$ecode66 = array("A","C","K","T");
$engine66 = array("289 4V","289 2V","289 4V HP","200 6cyl");
for ($x=0; $x<=4; $x++)
{
If (substr($vin,4,1) == $ecode[$x])
{$engineout = $engine66[$x]; }
}
break;
yadda yadda yadda...