specify array key value in string -
$row[4] = "comes database" - pincode eg. 364001 $code=$row[4]; $array=array("state name"=>$row[1] , "district" => $row[2] , "assembly" => $row[3], "code" => $code);
convert $code
string
means
"code"=> "$code"
but give error
so 364001 become string not number
how this?
to change variable type integer string possible using (string)
before variable name.
$int = 12345; var_dump($int); // int(12345) $str = (string)$int; var_dump($str); // string(5) "12345"
Comments
Post a Comment