Guillermo Rauch wrote:
If i understand you correctly, you want to extract all the keys and
generate class members with them..
// Define class test
class test {
// We pass an array to the constructor
function __construct( $arr ) {
foreach($arr as $key => $val ) {
If i understand you correctly, you want to extract all the keys and
generate class members with them..
// Define class test
class test {
// We pass an array to the constructor
function __construct( $arr ) {
foreach($arr as $key => $val ) {
$this-
is there any way to use extract , to extract the keys from an array to
$this vars for within a class ? Let me know.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
3 matches
Mail list logo