0

Okay, so I have this php code that I've been working on and I seem to be getting an error on the very last line of my code which is the "?>". I'll post the code and the error below:

Error:
"Parse error: parse error in C:\wamp\www\Services\VIN.php on line 64"

PHP Code:

<?php
function checkVIN($myVIN)
{
	$alphaNumCheck = true;

	$checkDigit = "";
	$alphaPool = array("","a","b","c","d","e","f","g","h","j","k","l","m","n","p","r","s","t","u","v","w","x","y","z");
	$alphaValue = array("",1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9);
	$digitWeight = array("",8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2);
	$finalWeight = array();
	
	if($alphaNumCheck)
	{
		$aryVinDigit = array();
		for($i = 1; $i <= 17; $i++)
		{
			if($alphaNumCheck)
			{
				$goodAlpha = false;
				for($x = 1; $x <= 23; $x++)
				{
					if($aryVinDigit[$i]==$alphaPool[$x])
					{
						$aryVinValue[$i] = $alphaValue[$x];
						$x = 24;
						$goodAlpha = true;
					}
					
				}
				if(!($goodAlpha))
				{
					$i = 18;
					return false;
				}
			}
			else
			{
				$aryVinValue[$i] = $aryVinDigit[$i];
			}
		}
	$totalWeight = 0;
	for($i = 1; $i <= 8; $i++)
	{
		$finalWeight[$i] = $aryVinValue[$i] * $digitWeight[$i];
		$finalWeight[$i+8] = $aryVinValue[$i+9] * $digitWeight[$i+9];
		$totalWeight = $totalWeight + $finalWeight[$i] + $finalWeight[$i+8];
	}
	$checkDigit = $totalWeight % 11;
	if($checkDigit == 10)
	{
		$checkDigit = "x";
	}
	if($checkDigit = $aryVinDigit[9])
	{
		return true;
	}
	else
	{
		return false;
	}
}

print_r(checkVIN("1M8GDM9AXKP042788"));
?>

Helping me is much appreciated :)

Edited by tweakernut: n/a

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by tweakernut
0

after line no 63 type end brace " } " for function, before "?>php"
or

line 12 if($alphaNumCheck) is without end brace " } "

Edited by urtrivedi: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.