使用下面的 PHP 代码片段可以检测用户浏览器所使用的语言 function get_client_language($availableLanguages, $default='…
Mandrill 是一款强大的 SMTP 提供器。开发者倾向于使用一个第三方 SMTP provider 来获取更好的收件交付。 下面的函数中,你需要把 “Mandrill.php…
function imagefromURL($image,$rename) { $ch = curl_init($image); curl_setopt($ch, CURLOPT_…
使用下面的 PHP 代码片段可以在一个目录中列出所有文件和文件夹 function list_files($dir) { if(is_dir($dir)) { if($handle…
function highlighter_text($text, $words) { $split_words = explode( " " , $words …
function secsToStr($secs) { if($secs>=86400){$days=floor($secs/86400);$secs=$secs%86400…
<?php $date1 = date( 'Y-m-d' ); $date2 = "2015-12-04"; $diff = abs(strtotime(…
之前我们提供了如何使用 Mandrill 发送邮件的 PHP 代码片段,但是如果你不想使用第三方服务,那么可以使用下面的 PHP 代码片段。 function send_mail(…
这个 PHP 片段可以帮助你让用户登录后直接跳转到之前浏览的页面 function current_url() { $url = "http://" . $_S…
function unzip($location,$newLocation) { if(exec("unzip $location",$arr)){ mkdir…
$json_string='{"id":1,"name":"rolf","country":&quo…
function resize_image($filename, $tmpname, $xmax, $ymax) { $ext = explode(".", $…