viernes, 23 de septiembre de 2016

json decode

response received from the remote host

{"location_original":null,"location_original_id":null,"location_1":"Franklin","location_1_id":"4","location_2":"Hart Lane","location_2_id":"7","location_3":"Hickory Hollow","location_3_id":"6","resp_code":0}


code to insert json values into an array
<?php
$url=file_get_contents("http://50.30.63.85:8012/sms_two_way/api/getBranchesByZipCode.php?zip_code=37067");

$url=json_decode($url, true);

foreach($url as $key=>$value){

echo " $key : $value<br>";

}
?>

PHP OUPUT

location_original :
location_original_id :
location_1 : Franklin
location_1_id : 4
location_2 : Hart Lane
location_2_id : 7
location_3 : Hickory Hollow
location_3_id : 6
resp_code : 0

jueves, 22 de septiembre de 2016

Generate PDF from MySQL Data using FPDF

http://phppot.com/php/generate-pdf-from-mysql-data-using-fpdf/

http://www.phpzag.com/how-to-create-pdf-with-php/

https://www.itechempires.com/2016/10/read-content-pdf-word-document-files-using-php/

Live Username Availability Check in PHP, AJAX & jQuery

http://www.kodingmadesimple.com/2016/09/live-username-availability-check-in-php-ajax-jquery.html

lunes, 19 de septiembre de 2016

viernes, 16 de septiembre de 2016

clean string

<?php

$member="MemberName: 555555";


function cleanstr($var) {
$var = explode(" ",$var);

$var=$var[1];

return $var;

}


echo cleanstr($member);

?>

lunes, 5 de septiembre de 2016

function check file

<?php

function check_message($message,$lang,$name) {

if (!file_exists($message)) {
   
    echo  "003 for bad path to the message";
System("curl http://46.101.131.21/dialer/code.php -G -d\"customergeneralid=$_GET[customergeneralid]&idoftheactualcall=$_GET[idoftheactualcall]&returncode=003\"");


exit();

}

if (!file_exists($lang)) {

    echo  "004 the target langauge doesnt exists";
System("curl http://46.101.131.21/dialer/code.php -G -d\"customergeneralid=$_GET[customergeneralid]&idoftheactualcall=$_GET[idoftheactualcall]&returncode=004\"");


exit();


}


if (!file_exists($name)) {

    echo  "001 the target name  doesnt exists";
System("curl http://46.101.131.21/dialer/code.php -G -d\"customergeneralid=$_GET[customergeneralid]&idoftheactualcall=$_GET[idoftheactualcall]&returncode=001\"");


exit();


}
}
?>

sábado, 3 de septiembre de 2016

replacing space for dash

<?php
$list="Ambiorix Rodirguez";

$nospace=str_replace (" " ,"-",$list );

echo $nospace;

//str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )


?>