Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

class php


<?php
class Foo {
    public $aMemberVar = 'aMemberVar Member Variable';
    public $aFuncName = 'aMemberFunc';
   
   
    function aMemberFunc() {
        print 'Inside `aMemberFunc()`';
    }
}

$foo = new Foo;

function getVarName()
{
     return 'aFuncName'; 
}

print $foo->{$foo->{getVarName()}}();

Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #class #php
ADD COMMENT
Topic
Name
6+5 =