Adsense
Popular Posts
- jQuery autocomplete scroll bar for dropdown menu
- JavaScript Arrays and Associate Arrays
- mod_auth_cas.so error: undefined symbol: SSL_connect
- Design date and signature box in Latex
- Install APXS in Redhat Linux
- JavaScript, remove trailing insignificant zeros after toFixed function
- jQuery, toggle the display
- Difference between state and props in React
- Set Windows path command line
- super(props) in React
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