I’m working with some API integration and I have a limitation with understanding Objects.
Not my code, but here’s what I have:
<?php
print_r(pingSample());
?>
The result on the browser is this:
PingResponse Object ( [PingResult] => 1 )
The function pingSample is not mine, it’s from Docusign.
I want to just extract the “1”, or if it’s a bad result I’m sure it will return “0”.
I’m not experienced with Object Oriented coding, yet. So, I’m assuming this is a simple example, in an API setting. But I’m not sure.
For those who want to laugh at my attempt:
$blah = pingSample();
echo $blah['PingResult'];
So far, nothing returns on the browser. Apache logs return this:
PHP Fatal error: Cannot use object of type PingResponse as array
How do I extract only the value of PingResult?
1 Answer