亚洲免费乱码视频,日韩 欧美 国产 动漫 一区,97在线观看免费视频播国产,中文字幕亚洲图片

      1. <legend id="ppnor"></legend>

      2. 
        
        <sup id="ppnor"><input id="ppnor"></input></sup>
        <s id="ppnor"></s>

        php獲取某個字符字母最后位置

        字號:


            <?php
            //php獲取最后一個特定字符位置,函數(shù)如下,
            /*
            * forasp 要查找的字符串
            * cn是要查找的特定字符
            */
            function get_last_code_pos($forasp,$cn){
            $forasparr= explode($cn,$forasp);
            $lastforaspcn = $forasparr[count($forasparr)-1];//獲取最后的一個分組
            return strlen($forasp)-strlen($lastforaspcn)-1;
            }
            $forasp = "這里是要查詢的字符串,www,www,forasp.cn,www網(wǎng)站制作學(xué)習(xí)網(wǎng)原創(chuàng),php獲取特定字符位置forasp.cn";//3w.foa($)sp.cn
            $cn ="www";
            echo get_last_code_pos($forasp,$cn);
            //結(jié)果51,在utf8下中文占3個字符位置
            $forasp = "abcdefgabcdefasp.cn";
            $cn ="c";//獲取最后一個字符c的位置
            echo get_last_code_pos($forasp,$cn);
            //結(jié)果17