note 23580 deleted from function.dotnet-load by sobak
| From: | sobak@php.net | Date: | Sun, 04 Dec 2016 07:32:36 +0000 |
| Subject: | note 23580 deleted from function.dotnet-load by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208128@lists.php.net to get a copy of this message | ||
Note Submitter: thomas dot weidner at voxtronic dot com
----
To realise functions within Microsoft.NET which can use with every type of parameter as boolean,
integer, string or any other type you want to use do the following.
Write your function in .NET :
CSharp Example :
MyFunction (params object[] parameters)
{
if (parameters[0].GetType().ToString() == "System.Int32")
return "Parameter 0 is an Integer";
return "Parameter 0 is no Integer";
}
Within PHP do the following :
$parameter[0] = 12345;
$parameter[1] = "My String";
$parameter[2] = false;
$obj = new COM ("NameSpace.Class");
$value = $obj -> MyFunction($parameter)
print($value);
How to work with params and object you could read within the .NET Documentation.
If you have any further question dont be afraid and write me...
Bye
Thomas