网站后台

15
Apr

php多条件联合查询及链接地址

<a href="/?region_id={zhuayi:echo.$fields['region_id'] /}<?php echo get_url('region_id');?>" class="<?php if($_GET['region_id'] && $fields['region_id'] == $_GET['region_id']){
9
Apr

php日期类代码

date_default_timezone_set('Asia/Shanghai');
#昨天
echo date("Y/m/d h:i:s",time()-24*60*60);
echo "<br>";
#前天
echo date("Y/m/d h:i:s",time()-2*24*60*60);
?>

1
Apr

php 当月 多少天

$firstday = mktime(0,0,0,$month,1,$year);
$tianshu = date('t',$firstday);           //获取指定月天数

16
Mar

分词链接

function highlight($title, $url, $body, $color='')
{  
    global $replace_num;
    $count = '';

4
Mar

php伪静态.htaccess设置

RewriteEngine on
########404页面########
ErrorDocument 404 /404.php
ErrorDocument 403 /404.php
########默认缺省页########
DirectoryIndex   index.ht
23
Feb

php数组合并,键值相加

<?php
$array1 = array("aaa" => 2, 'bbb'=>3, 'ccc'=>4); 
$array2 = array('aaa'=>4,'bbb'=>6,'ddd'=>5); 
14
Jan

判断来源ip

function get_remote_ip()
{
if (!empty($_SERVER["HTTP_CDN_SRC_IP"]) )
{

if (!empty($_SERVER["HTTP_CLIENT_IP"]) )
{
$ip = $_SERVER["HTTP_CLIENT_IP"];

30
Dec

修改host的批处理文件

echo #yoho.cn >> %windir%\SYSTEM32\drivers\etc\hosts
@attrib %windir%\SYSTEM32\drivers\etc\hosts -r

Syndicate content