note 116359 added to function.vprintf

From: Date: Thu, 18 Dec 2014 20:42:38 +0000
Subject: note 116359 added to function.vprintf
Groups: php.notes 
Request: Send a blank email to php-notes+get-201217@lists.php.net to get a copy of this message
If, instead of an array, you pass an object PHP will automatically cast the object as an array so you can use it directly in vprintf. <?php $object = new stdClass(); $object->Property1 = 'Value 1'; $object->Property2 = 'Value 2'; vprintf('%-20s %-20s', $object); /* will output Value 1 Value 2 */ ?> ---- Server IP: 72.52.91.14 Probable Submitter: 90.199.30.60 ---- Manual Page -- http://php.net/manual/en/function.vprintf.php Edit -- https://master.php.net/note/edit/116359 Del: integrated -- https://master.php.net/note/delete/116359/integrated Del: useless -- https://master.php.net/note/delete/116359/useless Del: bad code -- https://master.php.net/note/delete/116359/bad+code Del: spam -- https://master.php.net/note/delete/116359/spam Del: non-english -- https://master.php.net/note/delete/116359/non-english Del: in docs -- https://master.php.net/note/delete/116359/in+docs Del: other reasons-- https://master.php.net/note/delete/116359 Reject -- https://master.php.net/note/reject/116359 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201217) next »