Click here to Skip to main content
16,006,065 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
PHP
Class Record

{

public function getMessage()

{

return "Hello world";

}
}

//You can call this function like this:

$function = "getMessage";

$R = new Record;

call_user_func( array($R, $function   )  );
Posted

1 solution

Is the class defined in C# already? If yes, use the below code to call the function -

C#
Record r= new Record();
r.getMessage();


To define class, if it not defined in C# yet, use below -
C#
Class Record
 
{
 
public function getMessage()
 
{ 
return "Hello world";
 
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900