本文整理汇总了PHP中unslash函数的典型用法代码示例。如果您正苦于以下问题:PHP unslash函数的具体用法?PHP unslash怎么用?PHP unslash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unslash函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: herchi_1
public static function herchi_1($arr, $wanted = null, $soft_search = false)
{
$lists_obj = new lists();
$array = $lists_obj->{$arr};
// dd($array);
foreach ($array as $lev1) {
$key_en_name = $lev1[0][0];
$key_ar_name = $lev1[0][1];
$models_array_en = $models_array_ar = array();
foreach ($lev1[1] as $model) {
$models_array_en[slash($model[0])] = $model[0];
$models_array_ar[slash($model[0])] = $model[1];
}
$res_array[slash($key_en_name)] = ['list_name' => $arr, 'wanted' => $wanted, 'code_name' => slash($key_en_name), 'name_en' => strtolower($key_en_name), 'name_ar' => $key_ar_name, 'models_en' => $models_array_en, 'models_ar' => $models_array_ar];
}
// err($res_array);
if ($wanted != null) {
if (isset($res_array[unslash($wanted)])) {
return $res_array[unslash($wanted)];
}
if ($soft_search) {
return false;
}
die("error in herci_1 : " . $arr);
}
return $res_array;
}
开发者ID:Ahmed-Badawy,项目名称:ahmed-badawy.com-Website,代码行数:27,代码来源:Lists.php
示例2: spaceslink
/**
* replaces a link with blanks of same length
* The first string is the complete link and
* and the second optional string might be the
* alternative text that would become part of
* the result string and will be checked for
* spelling errors again.
*
* callback for preg_replace_callback
*
* @author Matthias Grimm <[email protected]>
* @author Andreas Gohr <[email protected]>
*/
function spaceslink($matches)
{
$string = unslash($matches[1]);
$check = unslash($matches[2]);
$result = ' ';
//opening [[
$result .= str_pad('', utf8_strlen($string), ' ');
$result .= $check;
$result .= ' ';
//closing ]]
return $result;
}
开发者ID:splitbrain,项目名称:dokuwiki-plugin-spellcheck,代码行数:25,代码来源:spellcheck.php
示例3: css_datauri
/**
* Convert local image URLs to data URLs if the filesize is small
*
* Callback for preg_replace_callback
*
* @param array $match
* @return string
*/
function css_datauri($match)
{
global $conf;
$pre = unslash($match[1]);
$base = unslash($match[2]);
$url = unslash($match[3]);
$ext = unslash($match[4]);
$local = DOKU_INC . $url;
$size = @filesize($local);
if ($size && $size < $conf['cssdatauri']) {
$data = base64_encode(file_get_contents($local));
}
if ($data) {
$url = 'data:image/' . $ext . ';base64,' . $data;
} else {
$url = $base . $url;
}
return $pre . $url;
}
开发者ID:janzoner,项目名称:dokuwiki,代码行数:27,代码来源:css.php
示例4: html_hilight_callback
/**
* Callback used by html_hilight()
*
* @author Harry Fuecks <[email protected]>
*/
function html_hilight_callback($m)
{
$hlight = unslash($m[0]);
if (!isset($m[2])) {
$hlight = '<span class="search_hit">' . $hlight . '</span>';
}
return $hlight;
}
开发者ID:nefercheprure,项目名称:dokuwiki,代码行数:13,代码来源:html.php
示例5: U
function U($str)
{
return ucwords(unslash($str));
}
开发者ID:Ahmed-Badawy,项目名称:ahmed-badawy.com-Website,代码行数:4,代码来源:layout_design_helper.php
示例6: testUnslash
function testUnslash()
{
$this->equals(unslash('foobar/'), 'foobar');
$this->equals(unslash('/foobar/'), '/foobar');
$this->equals(unslash('/foobar'), '/foobar');
$this->equals(unslash('/foobar///'), '/foobar');
}
开发者ID:rahulSinha,项目名称:simple-php-framework,代码行数:7,代码来源:test.functions.inc.php
示例7: arr_to_str
function arr_to_str($array, $delemeter = "/", $func = null)
{
if (!is_array($array)) {
die('<h1>arr_to_str() says: it isn\'s an array...</h1>');
}
// $str = implode($delemeter,$array);
$new = [];
foreach ($array as $key => $val) {
if ($func == 'slash') {
$new[$key] = slash($val);
} elseif ($func == 'unslash') {
$new[$key] = u(unslash($val));
} else {
$new[$key] = $val;
}
}
$str = implode($delemeter, $new);
return $str;
}
开发者ID:Ahmed-Badawy,项目名称:ahmed-badawy.com-Website,代码行数:19,代码来源:gene_helper.php
示例8: wp_nav_menu
<?php
wp_nav_menu(array('theme_location' => 'mobile', 'container' => false));
?>
</div>
<div id="page">
<?php
//Post Variables
$shade = climb_get_field('logo_shade', 'option');
function unslash($s)
{
$pattern = '/\\/$/';
// remove any ending slash
return preg_replace($pattern, '', $s);
}
$isDepartment = !(unslash(home_url()) == unslash(network_site_url()));
if (is_front_page()) {
$headerImageArr = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
$headerImage = $headerImageArr[0];
} else {
$headerImage = climb_get_field('header_background_image', 'option');
}
?>
<!-- HEADER -->
<?php
$main_header_styles = array();
if (is_front_page()) {
$main_header_styles[] = "home";
$featuredItems = get_field('featured_items');
}
开发者ID:BYU-ODH,项目名称:byu-humanities-department,代码行数:31,代码来源:header.php
示例9: testUnslash
function testUnslash()
{
$this->assertEquals('foobar', unslash('foobar/'));
$this->assertEquals('/foobar', unslash('/foobar/'));
$this->assertEquals('/foobar', unslash('/foobar'));
$this->assertEquals('/foobar', unslash('/foobar///'));
}
开发者ID:rbarrientos,项目名称:simple-php-framework,代码行数:7,代码来源:FunctionsTest.php
注:本文中的unslash函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论