join function is easy to use concate string from array.
example<php
$array = array('lastname', 'email', 'phone');
$comma_separated = join(",", $array);
echo $comma_separated; // lastname,email,phone
?>
(php4, php5);
Eclipse,Netbeans,Java,PHP,C/C++/C#,.NET,Visual Studio
////////////////////////////////// Lists(Numerical Arrays) /////////////////////////////////
/**
* A small function to remove an element from a list(numerical array)
* Arguments: $arr - The array that should be edited
* $value - The value that should be deleted.
* Returns : The edited array
*/
function array_remove($arr,$value) {
return array_values(array_diff($arr,array($value)));
}
////////////////////////////////// Associative Arrays //////////////////////////////////////
/**
* This function will remove all the specified keys from an array and return the final array.
* Arguments : The first argument is the array that should be edited
* The arguments after the first argument is a list of keys that must be removed.
* Example : array_remove_key($arr,"one","two","three");
* Return : The function will return an array after deleting the said keys
*/
function array_remove_key() {
$args = func_get_args();
$arr = $args[0];
$keys = array_slice($args,1);
foreach($arr as $k=>$v) {
if(in_array($k, $keys))
unset($arr[$k]);
}
return $arr;
}
/**
* This function will remove all the specified values from an array and return the final array.
* Arguments : The first argument is the array that should be edited
* The arguments after the first argument is a list of values that must be removed.
* Example : array_remove_value($arr,"one","two","three");
* Return : The function will return an array after deleting the said values
*/
function array_remove_value() {
$args = func_get_args();
$arr = $args[0];
$values = array_slice($args,1);
foreach($arr as $k=>$v) {
if(in_array($v, $values))
unset($arr[$k]);
}
return $arr;
}
//"ip.php" example- display user IP address on any page
Header("content-type: application/x-javascript");
$serverIP=$_SERVER['REMOTE_ADDR'];
echo "document.write(\"Your IP address is: " . $serverIP . "\")";
?>
CURL has support for proxies, including SSL. Below we refer to the code snippet in the first example, but modify it to use a proxy.
[php] // Initialize the CURL library
$cURL = curl_init();
// Set the URL to execute
curl_setopt($cURL, CURLOPT_URL, "http://www.google.com");
// Set options
curl_setopt($cURL, CURLOPT_HEADER, 1);
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cCURL, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($cCURL, CURLOPT_PROXY, "myproxy.com:1080");
curl_setopt($cCURL, CURLOPT_PROXYUSERPWD, "mysuername:mypassword");
// Execute, saving results in a variable
$strPage = curl_exec($cURL);
// Close CURL resource
curl_close($cURL);
// This will print out the HTML contents
echo($strPage);
?>[/php]
source : http://www.codeandcoffee.com
join function is easy to use concate string from array.
example$array = array('lastname', 'email', 'phone');
$comma_separated = join(",", $array);
echo $comma_separated; // lastname,email,phone
?>
(php4, php5);
| Framework | PHP4 | PHP5 | MVC | Multiple DB's | ORM | DB Objects | Templates | Caching | Validation | Ajax | Auth Module | Modules | EDP |
| Akelos | - | ||||||||||||
| ash.MVC | - | - | - | - | - | - | |||||||
| CakePHP | - | - | |||||||||||
| CodeIgniter | - | - | - | - | - | ||||||||
| DIY | - | - | - | - | - | - | |||||||
| eZ Components | - | - | - | - | - | - | - | ||||||
| Fusebox | - | - | - | - | - | - | |||||||
| PHP on TRAX | - | - | - | - | - | ||||||||
| PHPDevShell | - | - | - | - | - | - | - | - | |||||
| PhpOpenbiz | - | - | - | - | |||||||||
| Prado | - | ||||||||||||
| QPHP | - | - | |||||||||||
| Seagull | - | - | - | ||||||||||
| Symfony Project | - | - | - | ||||||||||
| WACT | - | - | - | - | - | ||||||||
| WASP | - | - | - | - | - | ||||||||
| Zend | - | - | - | - | |||||||||
| ZooP | - | - | - |