Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

call user method function syntax tag tutorial 2013 Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Php call user method () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 3>= 3.0.3, PHP 4 , PHP 5)

call_user_method --  Call a user method on an specific object [deprecated]

Syntax

mixed call_user_method ( string method_name, object &obj [, mixed parameter [, mixed ...]] )

Warning

The call_user_method() function is deprecated as of PHP 4.1.0, use the call_user_func() variety with the array(&$obj, "method_name") syntax instead.

Calls the method referred by method_name from the user defined obj object. An example of usage is below, where we define a class, instantiate an object and use call_user_method() to call indirectly its print_info method.

<?php
class Country {
    var
$NAME;
    var
$TLD;
    
    function
Country($name, $tld)
    {
        
$this->NAME = $name;
        
$this->TLD = $tld;
    }

    function
print_info($prestr = "")
    {
        echo
$prestr . "Country: " . $this->NAME . "\n";
        echo
$prestr . "Top Level Domain: " . $this->TLD . "\n";
    }
}

$cntry = new Country("Peru", "pe");

echo
"* Calling the object method directly\n";
$cntry->print_info();

echo
"\n* Calling the same method indirectly\n";
call_user_method("print_info", $cntry, "\t");
?>

See also call_user_func_array(), and call_user_func().

Php call user method Function syntax tag

call user method php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php call user method syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online