Adsense
Popular Posts
- Code update from PHP 7.4 to PHP 8.1 - PhpSpreadsheet
- MySQL workbench -"Could not decrypt password cache"
- Code update from PHP 7.4 to PHP 8.1 - Worksheet/Iterator.php
- Rendering HTML tags inside textarea
- axios handle blob type data
- Unix Utils and wget in Windows
- increase mysql query speed
- Setup vi syntax for PHP
- EXCEL return to the next line in the same cell
- Get WAMP running on EC2
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