本文整理汇总了PHP中utf8_strrev函数的典型用法代码示例。如果您正苦于以下问题:PHP utf8_strrev函数的具体用法?PHP utf8_strrev怎么用?PHP utf8_strrev使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了utf8_strrev函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: palindrom
function palindrom($string)
{
$string = str_replace(" ", "", $string);
if ($string == utf8_strrev($string)) {
return true;
} else {
return false;
}
}
示例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;
}
}
示例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();
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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 != "") {
示例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;
}
}
}
示例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;
}
}
示例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;
示例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]));
}
示例14: mdl_rev
function mdl_rev($val)
{
$val = trim($val);
return isset($val[0]) ? utf8_strrev($val) : 'Не указана строка';
}
示例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);
}