Remote Procedure Calls with PEAR::XML-RPC - The Example Script
(Page 2 of 12 )
For exploration purposes, let's create a small script that will make use of function calls.
<?php function getNameLength($name1, $name2) { $length = strlen($name1) + strlen($name2); return $length; }
$first = "George"; $last = "Washington"; $number = getNameLength($first, $last);
echo "<p>$first $last's name is $number letters long.</p>"; ?> |
It isn't too exciting... we've created getNameLength, a simple function which will accept a person's first and last name and return it's aggregate length. The name George has been set to $first, the name Washington has been set to $last and the return value of getNameLength will be set to $number. We've concluded the script by outputting our results.
Next: An XML_RPC Exchange >>
More Miscellaneous Articles
More By bluephoenix