• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP utf8_strrev函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中utf8_strrev函数的典型用法代码示例。如果您正苦于以下问题:PHP utf8_strrev函数的具体用法?PHP utf8_strrev怎么用?PHP utf8_strrev使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了utf8_strrev函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: isPalindrome

function isPalindrome($str)
{
    $temp = mb_convert_case($str, MB_CASE_LOWER, "UTF-8");
    $temp = preg_replace('/\\s+/', '', $temp);
    $tempRev = utf8_strrev($temp);
    return $tempRev == $temp ? mb_strlen($temp, "UTF-8") : false;
}
开发者ID:Goerik,项目名称:Tasks-on-Interview,代码行数:7,代码来源:pal.php


示例2: palindrom

function palindrom($string)
{
    $string = str_replace(" ", "", $string);
    if ($string == utf8_strrev($string)) {
        return true;
    } else {
        return false;
    }
}
开发者ID:Kocl9262,项目名称:palindrom,代码行数:9,代码来源:palindrom.php


示例3: isPal

function isPal($str)
{
    $str = preg_replace('/\\PL/u', '', $str);
    $str = mb_strtolower($str, 'UTF-8');
    if (utf8_strrev($str) == $str) {
        return true;
    } else {
        return false;
    }
}
开发者ID:elessarelfstone,项目名称:LoftPhpDZ2,代码行数:10,代码来源:task7.php


示例4: Download

 public function Download($link)
 {
     global $premium_acc, $Referer;
     $this->cookie = '';
     $this->apiurl = array('scheme' => 'http');
     // Add 's' for https :D
     $this->apiurl['host'] = 'api.rapidshare.com';
     $this->apiurl['path'] = '/cgi-bin/rsapi.cgi';
     $url = parse_url($link);
     if (!preg_match('@^/files/(\\d+)/([^\\r\\n\\t\\s\\?\\&<>/]+)@i', $url['path'], $m) && !empty($url['fragment']) && !preg_match('@!download\\|(?:[^\\|]+)\\|(\\d+)\\|([^\\|]+)@i', $url['fragment'], $m)) {
         html_error('Cannot get fileid or filename. Check your link.');
     }
     $Referer = "https://rapidshare.com/files/{$m[1]}/{$m[2]}";
     $this->fileid = $m[1];
     $this->filename = str_replace(array('?', '&'), '', basename(rawurldecode($m[2])));
     if ($_REQUEST['cookieuse'] == 'on' && preg_match('@enc\\s?=\\s?(\\w+)@i', $_REQUEST['cookie'], $c) || $_REQUEST['premium_acc'] == 'on' && !empty($premium_acc['rapidshare_com']['cookie']) || $_REQUEST["rs_acc"] == "on" && (!empty($_GET["rs_cookie"]) || !empty($_GET["rs_hash"]))) {
         if (!empty($_GET["rs_cookie"])) {
             $this->cookie = $_GET["rs_cookie"];
         } elseif (!empty($_GET["rs_hash"])) {
             $this->cookie = strrev(dcd($_GET["rs_hash"]));
         } else {
             $this->cookie = empty($c[1]) ? $premium_acc['rapidshare_com']['cookie'] : $c[1];
         }
         $this->CheckLogin();
     } elseif (!empty($_POST["sssid"]) || $_REQUEST['premium_acc'] == 'on' && ($_GET["maudl"] == 'multi' && !empty($_GET["auth_hash"]) || ($pA = !empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || !empty($premium_acc['rapidshare_com']['user']) && !empty($premium_acc['rapidshare_com']['pass']))) {
         if ($_GET["maudl"] == 'multi' && !empty($_GET["auth_hash"]) || !empty($_POST["sssid"])) {
             $ahash = $_GET["maudl"] == 'multi' && !empty($_GET["auth_hash"]) ? $_GET["auth_hash"] : $_POST["sssid"];
             $ahash = explode(":", base64_decode(utf8_strrev(dcd($ahash))));
             if (count($ahash) == 2 && (!empty($ahash[0]) && !empty($ahash[1]))) {
                 $_REQUEST["premium_user"] = $ahash[0];
                 $_REQUEST["premium_pass"] = $ahash[1];
             }
             unset($ahash);
         }
         $user = $pA ? $_REQUEST['premium_user'] : $premium_acc['rapidshare_com']['user'];
         $pass = $pA ? $_REQUEST['premium_pass'] : $premium_acc['rapidshare_com']['pass'];
         $this->CheckLogin(rawurlencode($user), rawurlencode($pass));
     } else {
         $this->StartDL();
     }
 }
开发者ID:laiello,项目名称:rapidleech36b,代码行数:41,代码来源:rapidshare_com.php


示例5: review_text

function review_text($review, $msg = array(), $allCultures = false)
{
    $routes = sfContext::getInstance()->getRouting()->getRoutes();
    if (array_key_exists('rules', $routes)) {
        $msg = array('offensive' => sfContext::getInstance()->getI18N()->__("Opinión tachada por el moderador (<a href='%1%'>ver normas de publicación</a>).", array('%1%' => sfContext::getInstance()->getRouting()->generate('rules'))), 'deleted' => sfContext::getInstance()->getI18N()->__("Opinión eliminada por el moderador (<a href='%1%'>ver normas de publicación</a>).", array('%1%' => sfContext::getInstance()->getRouting()->generate('rules'))));
    } else {
        $msg = array('offensive' => sfContext::getInstance()->getI18N()->__("Opinión tachada por el moderador."), 'deleted' => sfContext::getInstance()->getI18N()->__("Opinión eliminada por el moderador."));
    }
    $doShowText = $allCultures || ($review->getCulture() == '' || $review->getCulture() == sfContext::getInstance()->getUser()->getCulture());
    $text = $doShowText ? $review->getText() : '';
    if ($review->getSfReviewStatus()->getPublished() == 1) {
        if ($review->getSfReviewStatus()->getOffensive() == 0) {
            autolink($text);
            $ret = $text;
        } else {
            $ret = "<span style='text-decoration: line-through;'>" . utf8_strrev($text) . "</span>";
            $ret .= "<br />" . $msg['offensive'];
        }
    } else {
        $ret = "<br />" . $msg['deleted'] . "";
    }
    return $ret;
}
开发者ID:voota,项目名称:voota,代码行数:23,代码来源:SfReviewHelper.php


示例6: parse_url

     }
     // T-8: Check this.
 }
 $Url = parse_url($LINK);
 $Url['path'] = empty($Url['path']) ? '/' : str_replace('%2F', '/', rawurlencode(rawurldecode($Url['path'])));
 $LINK = rebuild_url($Url);
 if (empty($_GET['referer'])) {
     $Referer = $Url;
     // Remove login from Referer
     unset($Referer['user'], $Referer['pass']);
     $Referer = rebuild_url($Referer);
 } else {
     $Referer = trim(rawurldecode($_GET['referer']));
 }
 if ($Url['scheme'] != 'http' && $Url['scheme'] != 'https' && $Url['scheme'] != 'ftp') {
     $LINK = urlcleaner(utf8_strrev(base64_decode($LINK)));
     $Url = parse_url($LINK);
     if ($Url['scheme'] != 'http' && $Url['scheme'] != 'https' && $Url['scheme'] != 'ftp') {
         html_error($L->say['url_unknown']);
     }
 }
 if (empty($Url['user']) xor empty($Url['pass'])) {
     unset($Url['user'], $Url['pass']);
     $LINK = rebuild_url($Url);
 }
 if (isset($_GET['user_pass']) && $_GET['user_pass'] == 'on' && !empty($_GET['iuser']) && !empty($_GET['ipass'])) {
     $Url['user'] = $_GET['iuser'];
     $Url['pass'] = $_GET['ipass'];
     // Rebuild url
     $LINK = rebuild_url($Url);
 }
开发者ID:laiello,项目名称:rapidleech36b,代码行数:31,代码来源:index.php


示例7: testLinefeed

 function testLinefeed()
 {
     $str = "Iñtërnâtiôn\nàlizætiøn";
     $rev = "nøitæzilà\nnôitânrëtñI";
     $this->assertEqual(utf8_strrev($str), $rev);
 }
开发者ID:kidwellj,项目名称:scuttle,代码行数:6,代码来源:utf8_strrev.test.php


示例8: strrev

 /**
  * UTF-8 aware alternative to strrev
  * Reverse a string
  *
  * @param   string  $str  String to be reversed
  *
  * @return  string   The string in reverse character order
  *
  * @see     http://www.php.net/strrev
  * @since   11.1
  */
 public static function strrev($str)
 {
     jimport('phputf8.strrev');
     return utf8_strrev($str);
 }
开发者ID:nogsus,项目名称:joomla-platform,代码行数:16,代码来源:string.php


示例9: utf8_strrev

    $str_rev = utf8_strrev($str);
} else {
    $str = preg_replace("/[^a-z]/", "", $str);
    $len_str = strlen($str);
    $str_rev = strrev($str);
}
if (strcmp($str, $str_rev) == 0) {
    echo 'а) если строка является палиндромом,
    то она выводится полностью:' . '<br>' . $src_str . '<br>' . $str_rev . '<br>';
} else {
    $max_result = "";
    $len_strf = $str_encoding == "UTF-8" ? $len_str / 2 : $len_str;
    for ($k = 0; $k + 1 < $len_strf; ++$k) {
        for ($i = 0; $i + 1 < $len_strf - $k; ++$i) {
            $target_str = mb_substr($str, $k, $len_strf - $i - $k, $str_encoding);
            $str_rev = utf8_strrev($target_str);
            if (strcmp($target_str, $str_rev) == 0) {
                if ($str_encoding == "UTF-8") {
                    if (mb_strlen($target_str) > mb_strlen($max_result)) {
                        $max_result = $target_str;
                    }
                } else {
                    if (strlen($target_str) > strlen($max_result)) {
                        $max_result = $target_str;
                    }
                }
            }
        }
    }
}
if ($max_result != "") {
开发者ID:max-kmb,项目名称:test_from_litesoft,代码行数:31,代码来源:podpalindrom.php


示例10: is_palindrome

function is_palindrome($word)
{
    if (is_string($word)) {
        $word = strtolower($word);
        $reverse = utf8_strrev($word);
        if ($word == $reverse) {
            return true;
        } else {
            return false;
        }
    }
}
开发者ID:agolomazov,项目名称:Loftschool,代码行数:12,代码来源:index.php


示例11: check_polindrom

function check_polindrom($string)
{
    $delim = ' ';
    $arr = explode($delim, $string);
    $string = implode($arr);
    $string = mb_strtolower($string);
    function utf8_strrev($str)
    {
        preg_match_all('/./us', $str, $ar);
        return join('', array_reverse($ar[0]));
    }
    $reverce = utf8_strrev($string);
    if ($string === $reverce) {
        return true;
    } else {
        return false;
    }
}
开发者ID:EvgeniyaPronina,项目名称:php-home-tasks,代码行数:18,代码来源:functions.php


示例12: timer

 $audl_sect = false;
 $buflinks = $_POST['url'];
 if (getParam('|_curl', $buflinks) == 'on') {
     $fgc = 0;
     // use cURL mode ON
 }
 //locate section
 if (getParam('|_section', $buflinks) == 'audl') {
     $audl_sect = true;
 }
 if (!$audl_sect) {
     $lnk_timer = new timer();
     $lnk_timer->timer();
 }
 $valLink = getParam('|_url', $buflinks);
 $buflinks = urlcleaner(utf8_strrev(base64_decode($valLink)));
 $alllinks = array();
 $alllinks = explode(" ", $buflinks);
 $alllinks = implode(";", $buflinks);
 $alllinks = explode(";", trim($buflinks));
 //$alllinks = implode("\n", $buflinks);
 $l = 1;
 $x = 1;
 //$alllinks = array_unique($alllinks); //removes duplicates
 if (!count($alllinks)) {
     die('<p><br /><span style="color:red; background-color:#fec; padding:3px; border:2px solid #FFaa00"><b>Not LINK</b></span><br />');
 }
 echo "<result>";
 foreach ($alllinks as $link) {
     if (empty($link)) {
         continue;
开发者ID:laiello,项目名称:rapidleech36b,代码行数:31,代码来源:ajax_lnk.php


示例13: utf8_strrev

<?php 
$input = $_POST[“name”];
$reverse = utf8_strrev($input);
echo "The same string in reverse order {$reverse}";
function utf8_strrev($input)
{
    $input = "你好吗";
    preg_match_all('/./us', $input, $str);
    print_r($str[0]);
    print_r($str);
    return join('', array_reverse($str[0]));
}
开发者ID:roozbehmatloobi,项目名称:roozbehmatloobi,代码行数:12,代码来源:index.php


示例14: mdl_rev

function mdl_rev($val)
{
    $val = trim($val);
    return isset($val[0]) ? utf8_strrev($val) : 'Не указана строка';
}
开发者ID:Gazenwagen,项目名称:chat,代码行数:5,代码来源:rev.php


示例15: strrev

 /**
  * UTF-8 aware alternative to strrev
  * Reverse a string
  *
  * @param   string  $str  String to be reversed
  *
  * @return  string   The string in reverse character order
  *
  * @see     http://www.php.net/strrev
  * @since   2.0
  */
 public static function strrev($str)
 {
     if (!function_exists('utf8_strrev')) {
         require_once __DIR__ . '/phputf8/strrev.php';
     }
     return utf8_strrev($str);
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:18,代码来源:Utf8String.php


示例16: strtolower

        } else {
            $ktr = strtolower($ktr);
        }
        $rt .= $ktr;
    }
    if (strlen($nE) < 2) {
        $nE = trim('0' . $nE);
    }
    return $rt . $nE;
}
isset($_GET["sg_md5"]) ? $s_md5 = $_GET["sg_md5"] : ($s_md5 = '');
isset($_GET["md5"]) ? $p_md5 = $_GET["md5"] : ($p_md5 = '');
isset($_GET["rs"]) ? $rs_auth = $_GET["rs"] : ($rs_auth = '');
isset($_GET["key"]) ? $rs_key = $_GET["key"] : ($rs_key = '');
if ($s_md5 != '' && $p_md5 != '' && $rs_auth != '') {
    exit('null');
}
if ($p_md5 != '') {
    $parts = explode(":::", $p_md5);
    echo "_hash_" . utf8_strrev(base64_encode(md5($parts[0]) . ":" . md5($parts[1]))) . "_/hash_";
}
if ($rs_auth != '' && $rs_key != '') {
    $parts = explode(":::", $rs_auth);
    $usrpass = $parts[0] . ":" . $parts[1];
    $strROTr = rotN(strrev($usrpass), $rs_key);
    $encE = encEnti($strROTr, $rs_key);
    echo "_hash_" . $encE . "_/hash_";
}
if ($s_md5 != '') {
    echo "_hash_" . md5($s_md5) . "_/hash_";
}
开发者ID:laiello,项目名称:rapidleech36b,代码行数:31,代码来源:hash.php


示例17: strrev

 /**
  * UTF-8 aware alternative to strrev()
  *
  * Reverse a string.
  *
  * @param   string  $str  String to be reversed
  *
  * @return  string   The string in reverse character order
  *
  * @see     http://www.php.net/strrev
  * @since   1.3.0
  */
 public static function strrev($str)
 {
     return utf8_strrev($str);
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:16,代码来源:StringHelper.php


示例18: generate_statistics


//.........这里部分代码省略.........
                        //are there some results to play with?
                        if ($results > 0)
                        {
                            //calculate percentage
                            $gdata[] = ($row[0]/$results)*100;
                        }
                        //no results
                        else
                        {
                            //no data!
                            $gdata[] = "N/A";
                        }

                        //only add this if we don't handle question type "5"/"A"
                        if(!isset($justadded))
                        {
                            //put absolute data into array
                            $grawdata[]=$row[0];
                        }
                        else
                        {
                            //unset to handle "no answer" data correctly
                            unset($justadded);
                        }

                        //put question title and code into array
                        $label[]=$fname;

                        //put only the code into the array
                        $justcode[]=$al[0];

                        //edit labels and put them into antoher array
                        $lbl[] = wordwrap(FlattenText("$al[1] ($row[0])"), 25, "\n"); // NMO 2009-03-24
                        $lblrtl[] = utf8_strrev(wordwrap(FlattenText("$al[1] )$row[0]("), 25, "\n")); // NMO 2009-03-24

                    }	//end while -> loop through results

                }	//end foreach -> loop through answer data

                //no filtering of incomplete answers and NO multiple option questions
                //if ((incompleteAnsFilterstate() != "filter") and ($qtype != "M") and ($qtype != "P"))
                //error_log("TIBO ".print_r($showaggregated_indice_table,true));
                if (($qtype != "M") and ($qtype != "P"))
                {
                    //is the checkbox "Don't consider NON completed responses (only works when Filter incomplete answers is Disable)" checked?
                    //if (isset($_POST["noncompleted"]) and ($_POST["noncompleted"] == "on") && (isset($showaggregateddata) && $showaggregateddata == 0))
                    // TIBO: TODO WE MUST SKIP THE FOLLOWING SECTION FOR TYPE A and 5 when
                    // showaggreagated data is set and set to 1
                    if (isset($_POST["noncompleted"]) and ($_POST["noncompleted"] == "on") )
                    {
                        //counter
                        $i=0;

                        while (isset($gdata[$i]))
                        {
                            if (isset($showaggregated_indice_table[$i]) && $showaggregated_indice_table[$i]=="aggregated")
                            { // do nothing, we don't rewrite aggregated results
                                // or at least I don't know how !!! (lemeur)
                            }
                            else
                            {
                                //we want to have some "real" data here
                                if ($gdata[$i] != "N/A")
                                {
                                    //calculate percentage
                                    $gdata[$i] = ($grawdata[$i]/$TotalCompleted)*100;
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:67,代码来源:statistics_function.php


示例19: fundleftopen

function fundleftopen($str, $start)
{
    $strx = utf8_strrev($str);
    $x = getbetweensymb($strx, mb_strlen($str) - $start - 1, ")", "(");
    if ($x === false) {
        return false;
    }
    //var_dump($strx);
    //var_dump(mb_strlen($strx));
    //var_dump($x);
    //exit;
    return mb_strlen($str) - 1 - ($x['end'] - 1);
}
开发者ID:akadan47,项目名称:mdash,代码行数:13,代码来源:builder.py.php


示例20: header

<?php

header('content-type: text/html; charset=utf-8');
# Require the main "loader" script...
require_once '../../utf8.php';
# UTF8 constant can now be used for directory
# Follow functions automatically available;
# utf8_strlen, utf8_strpos, utf8_strrpos, utf8_substr,
# utf8_strtolower, utf8_strtoupper
# A UTF-8 string...
$str = 'Iñtërnâtiônàlizætiøn';
print "String is: {$str}<br>\n";
# Check it's a well formed UTF-8 string
require_once UTF8 . '/utils/validation.php';
if (utf8_is_valid($str)) {
    print "It's well formed UTF-8<br>\n";
} else {
    print "It's badly formed UTF-8 - this shouldn't happen<br>\n";
}
print "Num chars: " . utf8_strlen($str) . "<br>\n";
print "Uppercase: " . utf8_strtoupper($str) . "<br>\n";
# Load an additional function;
require_once UTF8 . '/strrev.php';
print "Reversed: " . utf8_strrev($str) . "<br>\n";
开发者ID:spacequad,项目名称:glfusion,代码行数:24,代码来源:1.php



注:本文中的utf8_strrev函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP utf8_strrpos函数代码示例发布时间:2022-05-23
下一篇:
PHP utf8_strpos函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap