I am trying to store a specific string from a php object called $json, which is the json_decoded response from a web service I call. In the course of debugging my problem, I echo out a serialized version of the string I am trying to store. This displays s:12:"392-445-9987";, which is exactly what I want. It is a string of length 12, and is the correct value. However when I try to assign it to $number the code dies and never reaches the next line.
if(isset($json->AddressService->response->phones)) {
echo "<textarea rows=50 cols=100>" . serialize($json->AddressService->response->phones[0]->phone_number) . "</textarea>";
$number = $json->AddressService->response->phones[0]->phone_number;
echo "I never reach this line!";
}
What am I missing? How do I save the string to the variable?
Thank so much for any thoughts you have.
Put this above it to see php errors echoed in your browser: