Maison php教程 PHP源码 分享一个PHP 网站SEO及过滤类,方便使用

分享一个PHP 网站SEO及过滤类,方便使用

May 25, 2016 pm 05:11 PM

在给网站页面做SEO的时候,长用到得一些函数。 
比如:良好URL生成,用户名过滤,email检测,截取字符串,全角替换成半角,删除html等 

1. [PHP]代码

<?php
 
class SeoTools
{
    public function friendlyURL($string, $replacement = &#39;-&#39;) {
        $map = array(
            &#39;/à|á|å|â|ä/&#39; => &#39;a&#39;,
            &#39;/è|é|ê|ẽ|ë/&#39; => &#39;e&#39;,
            &#39;/ì|í|î/&#39; => &#39;i&#39;,
            &#39;/ò|ó|ô|ø/&#39; => &#39;o&#39;,
            &#39;/ù|ú|ů|û/&#39; => &#39;u&#39;,
            &#39;/ç|č/&#39; => &#39;c&#39;,
            &#39;/ñ|ň/&#39; => &#39;n&#39;,
            &#39;/ľ/&#39; => &#39;l&#39;,
            &#39;/ý/&#39; => &#39;y&#39;,
            &#39;/ť/&#39; => &#39;t&#39;,
            &#39;/ž/&#39; => &#39;z&#39;,
            &#39;/š/&#39; => &#39;s&#39;,
            &#39;/æ/&#39; => &#39;ae&#39;,
            &#39;/ö/&#39; => &#39;oe&#39;,
            &#39;/ü/&#39; => &#39;ue&#39;,
            &#39;/Ä/&#39; => &#39;Ae&#39;,
            &#39;/Ü/&#39; => &#39;Ue&#39;,
            &#39;/Ö/&#39; => &#39;Oe&#39;,
            &#39;/ß/&#39; => &#39;ss&#39;,
            &#39;/ /&#39;=>&#39; &#39;,
            &#39;/ /&#39;=>&#39;&#39;,
       &#39;/~|·|!|@|#|¥|%|…|&|×|(|)|-|\+|=|『|【|』|】|、|:|;|“|”|\&#39;|
       《|,|》|。|?|\/|—|_|:|√|<|°|丶|>|-|★|||│|‖|ˇ/&#39;=>&#39; &#39;,
            &#39;/[^\w\s\x80-\xff]/&#39; => &#39; &#39;,
            &#39;/\\s+/&#39; => $replacement
        );
        $string = trim($string);
        $string = preg_replace(array_keys($map), array_values($map), $string);
        $string = preg_replace(&#39;/\\s+/&#39;,$replacement, strtolower($string));
        $string = trim($string,$replacement);
        return $string;
    }
     
    //判断email
    public function isEmail($mailAddr)
    {
        return strlen($mailAddr) > 6 && preg_match("/^[\w\-\.]+@[\w\-]+(\.\w+)+$/", $mailAddr);
 
    }
    //过滤用户
    public function CheckUser($string,$replacement = &#39;_&#39;)
    {
        $map = array(
            &#39;/à|á|å|â|ä/&#39; => &#39;a&#39;,
            &#39;/è|é|ê|ẽ|ë/&#39; => &#39;e&#39;,
            &#39;/ì|í|î/&#39; => &#39;i&#39;,
            &#39;/ò|ó|ô|ø/&#39; => &#39;o&#39;,
            &#39;/ù|ú|ů|û/&#39; => &#39;u&#39;,
            &#39;/ç|č/&#39; => &#39;c&#39;,
            &#39;/ñ|ň/&#39; => &#39;n&#39;,
            &#39;/ľ/&#39; => &#39;l&#39;,
            &#39;/ý/&#39; => &#39;y&#39;,
            &#39;/ť/&#39; => &#39;t&#39;,
            &#39;/ž/&#39; => &#39;z&#39;,
            &#39;/š/&#39; => &#39;s&#39;,
            &#39;/æ/&#39; => &#39;ae&#39;,
            &#39;/ö/&#39; => &#39;oe&#39;,
            &#39;/ü/&#39; => &#39;ue&#39;,
            &#39;/Ä/&#39; => &#39;Ae&#39;,
            &#39;/Ü/&#39; => &#39;Ue&#39;,
            &#39;/Ö/&#39; => &#39;Oe&#39;,
            &#39;/ß/&#39; => &#39;ss&#39;,
            &#39;/ /&#39;=>&#39; &#39;,
            &#39;/ /&#39;=>&#39;&#39;,
            &#39;/~|·|!|@|#|¥|%|…|&|×|(|)|-|\+|=|『|【|』|】|、|:|;|“|”|\&#39;|《|,|》|。
            |?|\/|—|_|:|√|<|°|丶|>|-|★|||│|‖|ˇ/&#39;=>&#39; &#39;,
            &#39;/[^\w\s\x80-\xff]/&#39; => &#39; &#39;,
            &#39;/\\s+/&#39; => $replacement
        );
        $string = trim($string);
        $string = preg_replace(array_keys($map), array_values($map), $string);
        $string = preg_replace(&#39;/\\s+/&#39;,$replacement, strtolower($string));
        $string = trim($string,$replacement);
        return $string;
    }
     
    public function mktitle($string, $replacement = &#39;_&#39;)
    {
        $map = array(
            &#39;/à|á|å|â|ä/&#39; => &#39;a&#39;,
            &#39;/è|é|ê|ẽ|ë/&#39; => &#39;e&#39;,
            &#39;/ì|í|î/&#39; => &#39;i&#39;,
            &#39;/ò|ó|ô|ø/&#39; => &#39;o&#39;,
            &#39;/ù|ú|ů|û/&#39; => &#39;u&#39;,
            &#39;/ç|č/&#39; => &#39;c&#39;,
            &#39;/ñ|ň/&#39; => &#39;n&#39;,
            &#39;/ľ/&#39; => &#39;l&#39;,
            &#39;/ý/&#39; => &#39;y&#39;,
            &#39;/ť/&#39; => &#39;t&#39;,
            &#39;/ž/&#39; => &#39;z&#39;,
            &#39;/š/&#39; => &#39;s&#39;,
            &#39;/æ/&#39; => &#39;ae&#39;,
            &#39;/ö/&#39; => &#39;oe&#39;,
            &#39;/ü/&#39; => &#39;ue&#39;,
            &#39;/Ä/&#39; => &#39;Ae&#39;,
            &#39;/Ü/&#39; => &#39;Ue&#39;,
            &#39;/Ö/&#39; => &#39;Oe&#39;,
            &#39;/ß/&#39; => &#39;ss&#39;,
            &#39;/ /&#39;=>&#39; &#39;,
            &#39;/ /&#39;=>&#39;&#39;,
            &#39;/~|·|!|@|#|¥|%|…|&|×|(|)|-|\+|=|『|【|』|】|、|:|;|“|”|\&#39;|《|,|》|。
            |?|\/|—|_|:|√|<|°|丶|>|-|★|||│|‖|ˇ/&#39;=>&#39; &#39;,
            &#39;/[^\w\s^.\x80-\xff]/&#39; => &#39; &#39;,
            &#39;/\\s+/&#39; => $replacement
        );
        $string = trim($string);
        $string = preg_replace(array_keys($map), array_values($map), $string);
        $string = preg_replace(&#39;/\\s+/&#39;,$replacement, strtolower($string));
        $string = trim($string,$replacement);
        return $string;
    }
     
    // 全角替换成半角
    public function Qj2bj($string)
    {
        $qj2bj = array(
            &#39;1&#39; => &#39;1&#39;, &#39;2&#39; => &#39;2&#39;, &#39;3&#39; => &#39;3&#39;, &#39;4&#39; => &#39;4&#39;, &#39;5&#39; => &#39;5&#39;,
            &#39;6&#39; => &#39;6&#39;, &#39;7&#39; => &#39;7&#39;, &#39;8&#39; => &#39;8&#39;, &#39;9&#39; => &#39;9&#39;, &#39;0&#39; => &#39;0&#39;,
            &#39;a&#39; => &#39;a&#39;, &#39;b&#39; => &#39;b&#39;, &#39;c&#39; => &#39;c&#39;, &#39;d&#39; => &#39;d&#39;, &#39;e&#39; => &#39;e&#39;,
            &#39;f&#39; => &#39;f&#39;, &#39;g&#39; => &#39;g&#39;, &#39;h&#39; => &#39;h&#39;, &#39;i&#39; => &#39;i&#39;, &#39;j&#39; => &#39;j&#39;,
            &#39;k&#39; => &#39;k&#39;, &#39;l&#39; => &#39;l&#39;, &#39;m&#39; => &#39;m&#39;, &#39;n&#39; => &#39;n&#39;, &#39;o&#39; => &#39;o&#39;,
            &#39;p&#39; => &#39;p&#39;, &#39;q&#39; => &#39;q&#39;, &#39;r&#39; => &#39;r&#39;, &#39;s&#39; => &#39;s&#39;, &#39;t&#39; => &#39;t&#39;,
            &#39;u&#39; => &#39;u&#39;, &#39;v&#39; => &#39;v&#39;, &#39;w&#39; => &#39;w&#39;, &#39;x&#39; => &#39;x&#39;, &#39;y&#39; => &#39;y&#39;,
            &#39;z&#39; => &#39;z&#39;, &#39;A&#39; => &#39;A&#39;, &#39;B&#39; => &#39;B&#39;, &#39;C&#39; => &#39;C&#39;, &#39;D&#39; => &#39;D&#39;,
            &#39;E&#39; => &#39;E&#39;, &#39;F&#39; => &#39;F&#39;, &#39;G&#39; => &#39;G&#39;, &#39;H&#39; => &#39;H&#39;, &#39;I&#39; => &#39;I&#39;,
            &#39;J&#39; => &#39;J&#39;, &#39;K&#39; => &#39;K&#39;, &#39;L&#39; => &#39;L&#39;, &#39;M&#39; => &#39;M&#39;, &#39;N&#39; => &#39;N&#39;,
            &#39;O&#39; => &#39;O&#39;, &#39;P&#39; => &#39;P&#39;, &#39;Q&#39; => &#39;Q&#39;, &#39;R&#39; => &#39;R&#39;, &#39;S&#39; => &#39;S&#39;,
            &#39;T&#39; => &#39;T&#39;, &#39;U&#39; => &#39;U&#39;, &#39;V&#39; => &#39;V&#39;, &#39;W&#39; => &#39;W&#39;, &#39;X&#39; => &#39;X&#39;,
            &#39;Y&#39; => &#39;Y&#39;, &#39;Z&#39; => &#39;Z&#39;, &#39; &#39; => &#39; &#39;
        );
        return strtr($string, $qj2bj);
    }
     
    public function DelNbsp($string)
    {
        $map = array(
            &#39;/ /&#39;=>&#39; &#39;,
            &#39;/\?/&#39;=>&#39; &#39;,
            &#39;/ /&#39;=>&#39;&#39;,
        );
        $string = preg_replace(array_keys($map), array_values($map), $string);
        $string = preg_replace(&#39;/\\s+/&#39;,&#39;&#39;,$string);
        return $string;
    }
    public function getZipcode($str)
    {
        $pattern = "/[0-9]{1}(\d+){4,5}/";
        preg_match_all($pattern,$str,$zipcodeArr); 
        if(empty($zipcodeArr[0]))
        {
            return &#39;&#39;;
        }
        else {
            return $zipcodeArr[0][0];
        }
     
    }
 
    public function checkZipcode($str)
    {
        $strwidth=strlen($str);
        $zipcode=$str;
        switch($strwidth)
        {
            case 4:$zipcode="00".$str;break;
            case 5:$zipcode="0".$str;break;
            case 6:$zipcode=$str;break;
            default:$zipcode="";break;
        }
        return $zipcode;
    }
     
    public function getEmail($str) { 
        $pattern = "/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i"; 
        preg_match_all($pattern,$str,$emailArr); 
        if(empty($emailArr[0]))
        {
            return &#39;&#39;;
        }
        else {
            $email_str=implode(",", $emailArr[0]);
            return $email_str;
        }
    } 
    public function getUrl($str)
    {
        $pattern = "/(http:\/\/|https:\/\/|ftp:\/\/)?([\w:\/\.\?=&-_]+)/is"; 
        preg_match_all($pattern,$str,$urlArr);
        if(empty($urlArr[0]))
        {
            return &#39;&#39;;
        }
        else {
            $url_str=implode(",", $urlArr[0]);
            $url_str=preg_replace(&#39;/(http:\/\/|https:\/\/|ftp:\/\/)/&#39;,&#39;&#39;,$url_str);
            return $url_str;
        }
 
         
    }
    public function match_links($document) {  
    $match=array();  
       preg_match_all("&#39;<\s*a\s.*?href\s*=\s*([\"\&#39;])?(?(1)(.*?)\\1|([^\s\>]+))[^>]*>?(.*?)
       </a>&#39;isx",$document,$links);                        
       while(list($key,$val) = each($links[2])) {
           if(!empty($val))
               $match[&#39;link&#39;][] = $val;
       }
       while(list($key,$val) = each($links[3])) {
           if(!empty($val))
               $match[&#39;link&#39;][] = $val;
       }        
       while(list($key,$val) = each($links[4])) {
           if(!empty($val))
               $match[&#39;content&#39;][] = $val;
       }
       while(list($key,$val) = each($links[0])) {
           if(!empty($val))
               $match[&#39;all&#39;][] = $val;
       }                
       return $match;
    }
    public function DelNoStr($string)
    {
        $map = array(
            &#39;/à|á|å|â|ä/&#39; => &#39;a&#39;,
            &#39;/è|é|ê|ẽ|ë/&#39; => &#39;e&#39;,
            &#39;/ì|í|î/&#39; => &#39;i&#39;,
            &#39;/ò|ó|ô|ø/&#39; => &#39;o&#39;,
            &#39;/ù|ú|ů|û/&#39; => &#39;u&#39;,
            &#39;/ç|č/&#39; => &#39;c&#39;,
            &#39;/ñ|ň/&#39; => &#39;n&#39;,
            &#39;/ľ/&#39; => &#39;l&#39;,
            &#39;/ý/&#39; => &#39;y&#39;,
            &#39;/ť/&#39; => &#39;t&#39;,
            &#39;/ž/&#39; => &#39;z&#39;,
            &#39;/š/&#39; => &#39;s&#39;,
            &#39;/æ/&#39; => &#39;ae&#39;,
            &#39;/ö/&#39; => &#39;oe&#39;,
            &#39;/ü/&#39; => &#39;ue&#39;,
            &#39;/Ä/&#39; => &#39;Ae&#39;,
            &#39;/Ü/&#39; => &#39;Ue&#39;,
            &#39;/Ö/&#39; => &#39;Oe&#39;,
            &#39;/ß/&#39; => &#39;ss&#39;,
            &#39;/ /&#39;=>&#39; &#39;,
            &#39;/ /&#39;=>&#39;&#39;,
            &#39;/~|·|!|@|#|¥|%|…|&|×|(|)|-|\+|=|『|【|』|】|、|:|;|“|”|’|《|,|》|。
            |?|\/|—|_|‘|:|√|<|°|丶|ˇ/&#39;=>&#39; &#39;,
            &#39;/[^\w\s\x80-\xff]/&#39; => &#39; &#39;,
           // &#39;/\\s+/&#39; => $replacement
        );
        $string = trim($string);
        $string = preg_replace(array_keys($map), array_values($map), $string);
        $string = preg_replace(&#39;/\\s+/&#39;,&#39;&#39;,$string);
        $string = trim($string,&#39;&#39;);
        return $string;
    }
    public function UrlToStr($string, $find = &#39;/-/&#39;)
    {   
        $string = preg_replace($find," ", strtolower($string));
        $string = trim($string);
        return $string;
    }
     
    public function GetPyLetter($str)
    {
        return substr(pinyin($str, $ucfirst=true), 0,1);
    }
    public function GetPinYin($str)
    {
        return strtolower(pinyin($str, $ucfirst=true));
    }
     
    public function DelCode($str)
    {
         
        $search = array("&#39;<script[^>]*?>.*?</script>&#39;si",    // strip out javascript
                        "&#39;<[\/\!]*?[^<>]*?>&#39;si",            // strip out html tags
                        "&#39;([\r\n])[\s]+&#39;",                  // strip out white space
                        "&#39;&(quot|#34|#034|#x22);&#39;i",        // replace html entities
                        "&#39;&(amp|#38|#038|#x26);&#39;i",         // added hexadecimal values
                        "&#39;&(lt|#60|#060|#x3c);&#39;i",
                        "&#39;&(gt|#62|#062|#x3e);&#39;i",
                        "&#39;&(nbsp|#160|#xa0);&#39;i",
                        "&#39;&(iexcl|#161);&#39;i",
                        "&#39;&(cent|#162);&#39;i",
                        "&#39;&(pound|#163);&#39;i",
                        "&#39;&(copy|#169);&#39;i",
                        "&#39;&(reg|#174);&#39;i",
                        "&#39;&(deg|#176);&#39;i",
                        "&#39;&(#39|#039|#x27);&#39;",
                        "&#39;&(euro|#8364);&#39;i",                // europe
                        "&#39;&a(uml|UML);&#39;",                   // german
                        "&#39;&o(uml|UML);&#39;",
                        "&#39;&u(uml|UML);&#39;",
                        "&#39;&A(uml|UML);&#39;",
                        "&#39;&O(uml|UML);&#39;",
                        "&#39;&U(uml|UML);&#39;",
                        "&#39;&szlig;&#39;i",
                        );
        $replace = array("",
                            "",
                            "\\1",
                            "\"",
                            "&",
                            "<",
                            ">",
                            " ",
                            chr(161),
                            chr(162),
                            chr(163),
                            chr(169),
                            chr(174),
                            chr(176),
                            chr(39),
                            chr(128),
                            "?",
                            "?",
                            "?",
                            "?",
                            "?",
                            "?",
                            "?",
                        );
        $str = preg_replace($search,$replace,$str);
        return trim($str);
    }
     
     
    public function CutStr($sourcestr,$cutlength)
    {
       $returnstr=&#39;&#39;;
       $i=0;
       $n=0;
       $sourcestr=rtrim(SeoTools::DelCode($sourcestr));
       $str_length=strlen($sourcestr);//字符串的字节数
        while (($n<$cutlength) and ($i<=$str_length))
        {
          $temp_str=substr($sourcestr,$i,1);
          $ascnum=Ord($temp_str);//得到字符串中第$i位字符的ascii码
          if ($ascnum>=224)    //如果ASCII位高与224,
          {
            $returnstr=$returnstr.substr($sourcestr,$i,3); //根据UTF-8编码规范,将3个连续的字符计为单个字符       
             $i=$i+3;            //实际Byte计为3
             $n++;            //字串长度计1
          }
          elseif ($ascnum>=192) //如果ASCII位高与192,
          {
             $returnstr=$returnstr.substr($sourcestr,$i,2); //根据UTF-8编码规范,将2个连续的字符计为单个字符
             $i=$i+2;            //实际Byte计为2
             $n++;            //字串长度计1
          }
          elseif ($ascnum>=65 && $ascnum<=90) //如果是大写字母,
          {
             $returnstr=$returnstr.substr($sourcestr,$i,1);
             $i=$i+1;            //实际的Byte数仍计1个
             $n++;            //但考虑整体美观,大写字母计成一个高位字符
          }
          else                //其他情况下,包括小写字母和半角标点符号,
          {
             $returnstr=$returnstr.substr($sourcestr,$i,1);
             $i=$i+1;            //实际的Byte数计1个
             $n=$n+0.5;        //小写字母和半角标点等与半个高位字符宽...
          }
        }
        if ($str_length>$i){
            $returnstr = $returnstr . ".";//超过长度时在尾处加上省略号
        }
        return htmlspecialchars($returnstr);
    }
     
    public function CreateTagLink($tags_str)
    {
        $tags_array=explode(",",$tags_str);
        $link_tpl="";
        foreach($tags_array as $v)
        {
            $tag=trim($v);
            $alias=SeoTools::friendlyURL($tag);
        //  $link_tpl.=&#39;<a href="/s/&#39;.urlencode($alias).&#39;" title="&#39;.$tag.&#39;">&#39;.$tag.&#39;</a>  &#39;;
            $link_tpl.=$tag.&#39;  &#39;;
        }
        return $link_tpl;
    }
     
}
 
 
 
 
/**
 * 中文转拼类
 *
 * @author  Lukin <my@lukin.cn>
 * @date    2011-01-25 10:44
 */
class PinYin {
    // 码表
    private $fp  = null;
    private $dat = &#39;pinyin.dat&#39;;
 
    public function __construct(){
        $this->dat = dirname(__FILE__).&#39;/&#39;.$this->dat;
        if (is_file($this->dat)) {
            $this->fp = fopen($this->dat, &#39;rb&#39;);
        }
    }
    /**
     * 转拼音
     *
     * @param string $str   汉字
     * @param bool $ucfirst 首字母大写
     * @param bool $polyphony 忽略多读音
     * @return string
     */
    public function encode($str, $ucfirst=true, $polyphony=true) {
        $ret = &#39;&#39;; $len = mb_strlen($str, &#39;UTF-8&#39;);
        for ($i = 0; $i < $len; $i++) {
            $py = $this->pinyin(mb_substr($str, $i, 1, &#39;UTF-8&#39;));
            if ($ucfirst && strpos($py,&#39;,&#39;) !== false) {
                $pys = explode(&#39;,&#39;, $py); 
                $ret.= implode(&#39;,&#39;, array_map(&#39;ucfirst&#39;, ($polyphony ? array_slice($pys, 0, 1) : $pys)));
            } else {
                $ret.= $ucfirst ? ucfirst($py) : $py;
               
            }
        }
         
        return $ret;
    }
    /**
     * 汉字转十进制
     *
     * @param string $word
     * @return number
     */
    private function char2dec($word) {
        $bins  = &#39;&#39;;
        $chars = str_split($word);
        foreach($chars as $char) $bins.= decbin(ord($char));
        $bins = preg_replace(&#39;/^.{4}(.{4}).{2}(.{6}).{2}(.{6})$/&#39;, &#39;$1$2$3&#39;, $bins);
        return bindec($bins);
    }
    /**
     * 单个字转拼音
     *
     * @param string $char  汉字
     * @return string
     */
    public function pinyin($char){
        if (strlen($char) == 3 && $this->fp) {
            $offset = $this->char2dec($char);
            // 判断 off 值
            if ($offset >= 0) {
                fseek($this->fp, ($offset - 19968) << 4, SEEK_SET);
                return trim(fread($this->fp, 16));
            }
        }
        return $char;
    }
 
    public function __destruct() {
        if ($this->fp) {
            fclose($this->fp);
        }
    }
}
/**
 * 取得实例
 *
 * @return $pinyin
 */
function &_pinyin_get_object() {
    static $pinyin;
    if ( is_null($pinyin) )
        $pinyin = new PinYin();
    return $pinyin;
}
 
if (!function_exists(&#39;pinyin&#39;)) :
/**
 * 取得拼音
 *
 * @param string $str
 * @param bool $ucfirst 首字母大写
 * @return string
 */
function pinyin($str, $ucfirst=true) {
    $py = _pinyin_get_object();
    return $py->encode($str, $ucfirst);
}
endif;
Copier après la connexion

以上就是分享一个PHP 网站SEO及过滤类,方便使用的内容,更多相关内容请关注PHP中文网(www.php.cn)!


Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn

Outils d'IA chauds

Undresser.AI Undress

Undresser.AI Undress

Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover

AI Clothes Remover

Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool

Undress AI Tool

Images de déshabillage gratuites

Clothoff.io

Clothoff.io

Dissolvant de vêtements AI

AI Hentai Generator

AI Hentai Generator

Générez AI Hentai gratuitement.

Article chaud

R.E.P.O. Crystals d'énergie expliqués et ce qu'ils font (cristal jaune)
2 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
Repo: Comment relancer ses coéquipiers
4 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: Comment obtenir des graines géantes
4 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
Combien de temps faut-il pour battre Split Fiction?
3 Il y a quelques semaines By DDD

Outils chauds

Bloc-notes++7.3.1

Bloc-notes++7.3.1

Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise

SublimeText3 version chinoise

Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1

Envoyer Studio 13.0.1

Puissant environnement de développement intégré PHP

Dreamweaver CS6

Dreamweaver CS6

Outils de développement Web visuel

SublimeText3 version Mac

SublimeText3 version Mac

Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Configuration du projet CakePHP Configuration du projet CakePHP Sep 10, 2024 pm 05:25 PM

Dans ce chapitre, nous comprendrons les variables d'environnement, la configuration générale, la configuration de la base de données et la configuration de la messagerie dans CakePHP.

Guide d'installation et de mise à niveau de PHP 8.4 pour Ubuntu et Debian Guide d'installation et de mise à niveau de PHP 8.4 pour Ubuntu et Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 apporte plusieurs nouvelles fonctionnalités, améliorations de sécurité et de performances avec une bonne quantité de dépréciations et de suppressions de fonctionnalités. Ce guide explique comment installer PHP 8.4 ou mettre à niveau vers PHP 8.4 sur Ubuntu, Debian ou leurs dérivés. Bien qu'il soit possible de compiler PHP à partir des sources, son installation à partir d'un référentiel APT comme expliqué ci-dessous est souvent plus rapide et plus sécurisée car ces référentiels fourniront les dernières corrections de bogues et mises à jour de sécurité à l'avenir.

Date et heure de CakePHP Date et heure de CakePHP Sep 10, 2024 pm 05:27 PM

Pour travailler avec la date et l'heure dans cakephp4, nous allons utiliser la classe FrozenTime disponible.

Téléchargement de fichiers CakePHP Téléchargement de fichiers CakePHP Sep 10, 2024 pm 05:27 PM

Pour travailler sur le téléchargement de fichiers, nous allons utiliser l'assistant de formulaire. Voici un exemple de téléchargement de fichiers.

Routage CakePHP Routage CakePHP Sep 10, 2024 pm 05:25 PM

Dans ce chapitre, nous allons apprendre les sujets suivants liés au routage ?

Discuter de CakePHP Discuter de CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP est un framework open source pour PHP. Il vise à faciliter grandement le développement, le déploiement et la maintenance d'applications. CakePHP est basé sur une architecture de type MVC à la fois puissante et facile à appréhender. Modèles, vues et contrôleurs gu

Comment configurer Visual Studio Code (VS Code) pour le développement PHP Comment configurer Visual Studio Code (VS Code) pour le développement PHP Dec 20, 2024 am 11:31 AM

Visual Studio Code, également connu sous le nom de VS Code, est un éditeur de code source gratuit – ou environnement de développement intégré (IDE) – disponible pour tous les principaux systèmes d'exploitation. Avec une large collection d'extensions pour de nombreux langages de programmation, VS Code peut être c

CakePHP créant des validateurs CakePHP créant des validateurs Sep 10, 2024 pm 05:26 PM

Le validateur peut être créé en ajoutant les deux lignes suivantes dans le contrôleur.

See all articles