Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
356
PHP XML RPC Function Encode
PHP Version: (PHP 4 >= 4.1.0, PHP 5)
Description
This function generates XML string for a PHP value.
Usage:
string xmlrpc_encode ( mixed
value)
This function generates xml
string for any PHP value. The main objective of this function is to encode the php value into xml string so that it can be used for
XML-RPC call.
Example:
In the example, I have
created a data type and encoded it into xml string and printed the xml string.
PHP
Code:
<?php
//create a date type value
$date = date("l
dS of F Y h:i:s A");
//encode the php value
$encodevalue
= xmlrpc_encode($date);
//echo out the encoded type
echo $encodevalue;
?>
Output:
<?xml version="1.0"
encoding="utf-8"?>
<params>
<param>
<value>
<string>Saturday
15th of January 2005 10:32:40 PM</string>