Scripts posted recently tagged to php in Kelpi

1- 10 of 13.

simple socket client

to sockets client php by nando.quintana

<?php
$fp = fsockopen( "127.0.0.1", 30000, $errno,$errdesc);
$request = "mensaje de prueba";
fputs($fp, $request);
echo fgets($fp, 32);

PHP Convert XML to Array

to php xml array convert by anonymous

function xml2array($object) {
	$return = NULL;
	if(is_array($object)) {
		foreach($object as $key => $value) $return[$key] = xml2array($value);
	} else {

PHP UTF-8 encoding

to php unicode encode utf-8 by jatsu

header('Content-type: text/html; charset=UTF-8');

Lighttpd server configuration with php

to php lighttpd server config apache by anonymous

fastcgi.server = ( ".php" => (( 
                     "bin-path" => "/path/to/php-cgi",
                     "socket" => "/tmp/php.socket",
                     "max-procs" => 2,
                     "bin-environment" => ( 

Delete web browser cookies

to php cookies by anonymous

http://www.gamarod.com.ar/trucos/eliminar_cookie_php.asp

<?php
function clear_cookies()
{

Filtrar resultados jsonp para gadget de autocompletado

to json jsonp php by nando.quintana

// devuelve la función de activación JSONP si existe el parámetro "callback"
//
// recorre la lista de calles y solo muestra las que comienzan por la subcadena en el parámetro "q"
//

grados equivalentes en Fahrenheit y Celsius

to php grados fahrenheit celsius by nando.quintana

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tabla Fahreheit & Celsius</title>

Counting to 10

to html xhtml php by nando.quintana

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

a trivial mqlread proxy in PHP

to php freebase by nando.quintana

<?php
$q = str_replace("\\\"", "\"", $_GET["queries"]);
$url = "http://www.freebase.com/api/service/mqlread?queries=" . urlencode($q);
$request = curl_init($url);
curl_setopt($request, CURLOPT_COOKIE, "###freebase.com cookie data here###");

A Metaweb-enabled web application in PHP

to php freebase by nando.quintana

<html>
<body>
<form>Band: <input type="text" name="band"><input type="submit"></form>
<?php
$band = $_GET["band"];        // What band is specified in the URL?
hits counter