La función es la siguiente:
function pttopx(valpt){
var valpx = parseInt(valpt, 10);
valpx = parseInt(((valpx*96)/72), 10);
return valpx;
}
function pttopx(valpt){
var valpx = parseInt(valpt, 10);
valpx = parseInt(((valpx*96)/72), 10);
return valpx;
}
function deleteDirectory($dir){
$result = false;
if ($handle = opendir("$dir")){
$result = true;
while ((($file=readdir($handle))!==false) && ($result)){
if ($file!='.' && $file!='..'){
if (is_dir("$dir/$file")){
$result = deleteDirectory("$dir/$file");
} else {
$result = unlink("$dir/$file");
}
}
}
closedir($handle);
if ($result){
$result = rmdir($dir);
}
}
return $result;
}
SELECT * FROM tabla ORDER BY RAND() LIMIT 1;
$res = mysqli->query("SELECT count(*) FROM tabla");
$fila = $res->fetch_row();
$rand = mt_rand(0, $fila[0] – 1);
$res = mysqli->query("SELECT * FROM tabla LIMIT $rand, 1");
require_once("nusoap.php");
$server = new soap_server();
$server->register('multiplicarNumeros');
function multiplicarNumeros($valor1, $valor2){
$res = $valor1 * $valor2;
return $res;
}
$server->service($HTTP_RAW_POST_DATA);
require_once("nusoap.php");
$cliente = new nusoap_client("http://localhost/test.php");
$error = $cliente->getError();
if ($error){
echo "Error: $error";
}
$res = $cliente->call("multiplicarNumeros", array("valor1" => "10", "valor2" => "15"));
$error = $cliente->getError();
if ($error){
echo "Error: $error";
} else {
echo "Resultado: $res";
}
require_once("nusoap.php");
$server = new soap_server();
// Configuramos el namespace y el WSDL
$ns = "test";
$server->configureWSDL('test', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
// Cambiamos la llamada para añadirle los parámetros de entrada y salida y el namespace
$server->register('multiplicarNumeros', array('valor1' => 'xsd:integer', 'valor2' => 'xsd:integer'), array('return' => 'xsd:integer'), $ns);
function multiplicarNumeros($valor1, $valor2){
$res = $valor1 * $valor2;
return $res;
}
$server->service($HTTP_RAW_POST_DATA);