/ Published in: PHP

Credit Card Verification
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function object_2_array($result){ foreach ($result as $key=>$value) { # if $value is an object then { #run the $value through the function again. $array[$key]=object_2_array($value); } # if $value is an array then { #run the $value through the function again?????? $array[$key]=object_2_array($value); } # if $value is not an array then (it also includes objects) else { $array[$key]=$value; } } return $array; } function checkcreditcardValidity( $cardno = 0){ $client = new soapClient('http://ws.cdyne.com/creditcardverify/luhnchecker.asmx?wsdl'); $arr = object_2_array($result); $arr1 = object_2_array($arr['CheckCCResult']); //$arr1['CardType']; if( $arr1['CardValid'] != '1' ){ return false; } return true; } /*----------------------------------------------------------------------------*/
Comments
