Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Pruebas con enteros
- $a_value = 1;
- $b_value = 0;
- $c_value = 1;
- $int_feature = array("A" => $a_value,
- "B" => $b_value,
- "C" => $c_value,
- );
- $featureJsonInt = json_encode($int_feature);
- echo "Entero: " . $featureJsonInt." | ";
- $resultado_int = json_decode($featureJsonInt);
- var_dump($resultado_int);
- //Pruebas con Strings
- $a_str_value = "1";
- $b_str_value = "0";
- $c_str_value = "1";
- $str_feature = array("A" => $a_str_value,
- "B" => $b_str_value,
- "C" => $c_str_value,
- );
- $featureJsonStr = json_encode($str_feature);
- echo "String: ". $featureJsonStr." | ";
- $resultado_str = json_decode($featureJsonStr);
- var_dump($resultado_str);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement