Adsense
Popular Posts
- MySQL workbench -"Could not decrypt password cache"
- peer review (3)
- PHP, dump varailbes in a format way
- "Unusual traffic from your computer network" from blogger
- Install APXS in Redhat Linux
- JavaScript, remove trailing insignificant zeros after toFixed function
- Update member directory
- Set Windows path command line
- JavaScript: add days to current date
- DataTable table order by numeric, not by text
Thursday, June 26, 2014
Extract variables from an object stdclass in PHP using get_object_vars
PHP code to dump $fte
<?php
echo var_dump($fte) ;
?>
Output:
array(1) { [0]=> object(stdClass)#34 (1) { ["sumfte"]=> string(18) "369.74986600875854" } }
To extract value 369.74986600875854 from this stdclass, we need to use get_object_vars
<?php
$ftesum=get_object_vars($fte[0]);
echo $ftesum['sumfte'];
?>
which returns
369.74986600875854
Labels:
php
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment