本文整理汇总了PHP中strchr函数的典型用法代码示例。如果您正苦于以下问题:PHP strchr函数的具体用法?PHP strchr怎么用?PHP strchr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strchr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_md5
private function get_md5()
{
// getting the md5 hash of the file
$a[0] = $this->html->getElementByTagName("div.window_section")->nextsibling()->childNodes(1)->childNodes(0)->plaintext;
$a[1] = $this->html->getElementByTagName("div.window_section")->nextsibling()->nextsibling()->childNodes(1)->childNodes(0)->plaintext;
$this->md = trim(substr(strchr($a[0], "MD5:") ? $a[0] : $a[1], 4));
}
开发者ID:vkisku,项目名称:apk_download,代码行数:7,代码来源:apk.php
示例2: isRotation
/**
* @TODO ! BAM
*
* @param $s1
* @param $s2
*
* @return bool|int
*/
public static function isRotation($s1, $s2)
{
if (!strchr($s2 . $s2, $s1)) {
return false;
}
return true;
}
开发者ID:sowbiba,项目名称:hackathon-dev-copy,代码行数:15,代码来源:RotationString.php
示例3: updateUser
public function updateUser($id)
{
$req = $this->app->request();
$imageName = $_FILES['image']['name'];
$imageTmp = $_FILES['image']['tmp_name'];
$uniqueID = md5(uniqid(rand(), true));
$fileType = strchr($imageName, '.');
$newUpload = 'assets/img_public/' . $uniqueID . $fileType;
if ($imageName != null) {
unlink(User::showImageUser($id));
}
move_uploaded_file($imageTmp, $newUpload);
@chmod($newUpload, 0777);
if ($imageName != null) {
$sql = 'UPDATE users SET u_email = :u_email, u_password = :u_password, u_image = :u_image, level = :level WHERE user_id = :id';
} else {
$sql = 'UPDATE users SET u_email = :u_email, u_password = :u_password, level = :level WHERE user_id = :id';
}
$this->users = parent::connect()->prepare($sql);
$this->users->bindValue(':u_email', $req->post('email'));
$this->users->bindValue(':u_password', Bcrypt::hash($req->post('password')));
if ($imageName != null) {
$this->users->bindValue(':u_image', $newUpload);
}
$this->users->bindValue(':level', $req->post('level'));
$this->users->bindValue(':id', $id);
try {
$this->users->execute();
} catch (PDOException $e) {
die($e->getMessage());
}
}
开发者ID:Rotron,项目名称:ecommerce,代码行数:32,代码来源:User.php
示例4: get
public function get($handle, $id)
{
$result = array();
$lyric = '';
// id should be url of lyric
if (strchr($id, $this->sitePrefix) === FALSE) {
return FALSE;
}
$content = FujirouCommon::getContent($id);
if (!$content) {
return FALSE;
}
$prefix = "<div class='lyricbox'>";
$suffix = "<!--";
$lyricLine = FujirouCommon::getSubString($content, $prefix, $suffix);
$pattern = '/<\\/script>(.*)<!--/';
$matchedString = FujirouCommon::getFirstMatch($lyricLine, $pattern);
if (!$matchedString) {
return FALSE;
}
$lyric = trim(str_replace('<br />', "\n", $matchedString));
$lyric = FujirouCommon::decodeHTML($lyric);
$lyric = trim(strip_tags($lyric));
$handle->addLyrics($lyric, $id);
return TRUE;
}
开发者ID:Tstassin,项目名称:synology-scrobbler,代码行数:26,代码来源:lyric.php
示例5: thumbnail2
public function thumbnail2(Request $request)
{
if ($request->hasFile('thumbnail_file2')) {
$messages = ['photo.image' => '上传文件必须是图片', 'photo.max' => '上传文件不能大于:maxkb'];
$this->validate($request, ['photo' => 'image|max:100000'], $messages);
if ($request->file('thumbnail_file2')->isValid()) {
$OriginalName = $request->file('thumbnail_file2')->getClientOriginalName();
$file_pre = sha1(time() . $OriginalName);
//取得当前时间戳
$file_suffix = substr(strchr($request->file('thumbnail_file2')->getMimeType(), "/"), 1);
//取得文件后缀
$destinationPath = 'uploads';
//上传路径
$fileName = $file_pre . '.' . $file_suffix;
//上传文件名
Image::make($request->file('thumbnail_file2'))->resize(300, null, function ($constraint) {
$constraint->aspectRatio();
})->save('uploads/thumbnails/' . $fileName);
$request->file('thumbnail_file2')->move($destinationPath, $fileName);
$img = new Img();
$img->name = $fileName;
$img->save();
Session()->flash('img2', $fileName);
return $fileName;
} else {
return "上传文件无效!";
}
} else {
return "文件上传失败!";
}
}
开发者ID:goyuquan,项目名称:album,代码行数:31,代码来源:AdminController.php
示例6: SOAP_Test
function SOAP_Test($methodname, $params, $expect = NULL, $cmp_func = NULL)
{
# XXX we have to do this to make php-soap happy with NULL params
if (!$params) {
$params = array();
}
if (strchr($methodname, '(')) {
preg_match('/(.*)\\((.*)\\)/', $methodname, $matches);
$this->test_name = $methodname;
$this->method_name = $matches[1];
} else {
$this->test_name = $this->method_name = $methodname;
}
$this->method_params = $params;
if ($expect !== NULL) {
$this->expect = $expect;
}
if ($cmp_func !== NULL) {
$this->cmp_func = $cmp_func;
}
// determine test type
if ($params) {
$v = array_values($params);
if (gettype($v[0]) == 'object' && (get_class($v[0]) == 'SoapVar' || get_class($v[0]) == 'SoapParam')) {
$this->type = 'soapval';
}
}
}
开发者ID:garybulin,项目名称:php7,代码行数:28,代码来源:client_round2_params.php
示例7: putCSV
/**
* @param $handle
* @param $fields
* @param string $delimiter
* @param string $enclosure
* @param bool $useArrayKey
* @param string $escape
*/
public static function putCSV($handle, $fields, $delimiter = ',', $enclosure = '"', $useArrayKey = false, $escape = '\\')
{
$first = 1;
foreach ($fields as $key => $field) {
if ($first == 0) {
fwrite($handle, $delimiter);
}
if ($useArrayKey) {
$f = str_replace($enclosure, $enclosure . $enclosure, $key);
} else {
$field = EXPORT_ENCODE_FUNCTION != "none" && function_exists(EXPORT_ENCODE_FUNCTION) ? call_user_func(EXPORT_ENCODE_FUNCTION, $field) : $field;
$f = str_replace($enclosure, $enclosure . $enclosure, $field);
}
if ($enclosure != $escape) {
$f = str_replace($escape . $enclosure, $escape, $f);
}
if (strpbrk($f, " \t\n\r" . $delimiter . $enclosure . $escape) || strchr($f, "")) {
fwrite($handle, $enclosure . $f . $enclosure);
} else {
fwrite($handle, $f);
}
$first = 0;
}
fwrite($handle, "\n");
}
开发者ID:arnon22,项目名称:transportcm,代码行数:33,代码来源:FileManager.php
示例8: stripallslashes
function stripallslashes($string)
{
while (strchr($string, '\\')) {
$string = stripslashes($string);
}
return $string;
}
开发者ID:Otti0815,项目名称:picosafe_webgui,代码行数:7,代码来源:class.secure.php
示例9: index
public function index($doc_id = NULL)
{
$docss[0] = array("Basic Instructions" => 'basics.html');
$docss[1] = array("Answering Queries" => 'queries.html');
$docss[2] = array('Add Assignment' => "add_assignment.html", "Sample Assignment" => "sample_assignment.html", "Detect similar codes" => "moss.html", "Tests Structure" => "tests_structure.html", "Assignment Helper" => "assignment_helper.html");
$docss[3] = array('About The Campus Judge' => 'readme.html', 'Users' => "users.html", 'Clean urls' => "clean_urls.html", 'Installation' => "installation.html", 'Settings' => "settings.html", 'Sandboxing' => "sandboxing.html", 'Security' => "security.html", 'Shield' => "shield.html");
$baseaddr = "assets/docs/html/";
//$filename="index.html";
$level = $this->user->level;
$docs = [];
for ($i = 0; $i <= $level; $i++) {
$docs = array_merge($docs, $docss[$i]);
}
if ($doc_id === NULL) {
$data = array('all_assignments' => $this->assignment_model->all_assignments(), 'docs' => array_keys($docs));
$this->twig->display('pages/docslist.twig', $data);
} else {
if (strchr($doc_id, ".md")) {
$doc_id = array_search(str_replace(".md", ".html", $doc_id), $docs);
}
if ($doc_id && array_key_exists($doc_id, $docs)) {
$data = array('all_assignments' => $this->assignment_model->all_assignments(), 'page' => file_get_contents($baseaddr . $docs[$doc_id]));
//echo file_get_contents($baseaddr.$filename);
$this->twig->display('pages/docview.twig', $data);
} else {
show_404();
}
}
}
开发者ID:shubham1559,项目名称:The-Campus-Judge,代码行数:29,代码来源:Docs.php
示例10: image_thumb_onfly
function image_thumb_onfly($image_path, $height, $width, $crop = FALSE, $ratio = TRUE)
{
// Get the CodeIgniter super object
$CI =& get_instance();
$ext = strchr($image_path, '.');
$file_name = substr(basename($image_path), 0, -strlen($ext));
// Path to image thumbnail
$image_thumb = dirname($image_path) . '/' . $file_name . '_' . $height . '_' . $width . $ext;
if (!file_exists($image_thumb)) {
// LOAD LIBRARY
$CI->load->library('image_lib');
// CONFIGURE IMAGE LIBRARY
$config['image_library'] = 'gd2';
$config['source_image'] = $image_path;
$config['new_image'] = $image_thumb;
$config['maintain_ratio'] = $ratio;
$config['height'] = $height;
$config['width'] = $width;
$CI->image_lib->initialize($config);
if ($crop) {
$CI->image_lib->crop();
} else {
$CI->image_lib->resize();
}
$CI->image_lib->clear();
}
return '<img src="' . dirname($_SERVER['SCRIPT_NAME']) . '/' . $image_thumb . '" onerror="loadNoPic(this,\'' . base_url() . '\')"/>';
}
开发者ID:Ankitj13,项目名称:sss,代码行数:28,代码来源:image_helper.php
示例11: updateCarousel
public function updateCarousel($id)
{
$req = $this->app->request();
$imageName = $_FILES['image']['name'];
$imageTmp = $_FILES['image']['tmp_name'];
$uniqueID = md5(uniqid(rand(), true));
$fileType = strchr($imageName, '.');
$newUpload = 'assets/img_public/' . $uniqueID . $fileType;
if ($imageName != null) {
unlink(carousel::showImagecarousel($id));
}
move_uploaded_file($imageTmp, $newUpload);
@chmod($newUpload, 0777);
if ($imageName != null) {
$sql = 'UPDATE carousels SET image = :image, title = :title, description = :description where carousel_id = :id';
} else {
$sql = 'UPDATE carousels SET title = :title, description = :description where carousel_id = :id';
}
$this->carousels = parent::connect()->prepare($sql);
if ($imageName != null) {
$this->carousels->bindValue(':image', $newUpload);
}
$this->carousels->bindValue(':title', $req->post('title'));
$this->carousels->bindValue(':description', $req->post('description'));
$this->carousels->bindValue(':id', $id);
try {
$this->carousels->execute();
} catch (PDOException $e) {
die($e->getMessage());
}
}
开发者ID:Rotron,项目名称:ecommerce,代码行数:31,代码来源:Carousel.php
示例12: fputcsv
static function fputcsv($handle, $row, $fd = ',', $quot = '"')
{
$str = '';
$nums = count($row);
$i = 1;
foreach ($row as $cell) {
$cell = trim($cell);
if (!self::detectUTF8($cell)) {
$cell = @iconv('gb2312', 'utf-8', $cell);
}
//
if (empty($cell)) {
continue;
}
$cell = str_replace(array($quot, "\n"), array($quot . $quot, ''), $cell);
if ($i < $nums) {
if ($fd && strchr($cell, $fd) !== FALSE || strchr($cell, $quot) !== FALSE) {
$str .= $quot . $cell . $quot . $fd;
} else {
$str .= $cell . $fd;
}
} else {
$str .= $cell . $quot;
}
$i++;
}
fputs($handle, substr($str, 0, -1) . "\n");
return strlen($str);
}
开发者ID:rocketyang,项目名称:mincms,代码行数:29,代码来源:Csv.php
示例13: FindCitiesByNameLocal
/**
* Finds cities on given name and country
*
* @param string $p_cityName
* @param string $p_countryCode
*
* @return array
*/
public function FindCitiesByNameLocal($p_cityName, $p_countryCode = '')
{
global $g_ado_db;
$cityName_changed = str_replace(' ', '%', trim($p_cityName));
$is_exact = !strchr($p_cityName, '%');
$queryStr = 'SELECT DISTINCT id, city_name as name, country_code as country, population, X(position) AS latitude, Y(position) AS longitude
FROM ' . $this->m_dbTableName . ' WHERE city_name LIKE ?';
if (!empty($p_countryCode)) {
$queryStr .= ' AND cl.country_code = ?';
}
$sql_params = array($p_cityName, $cityName_changed, $cityName_changed . '%', '%' . $cityName_changed . '%');
$queryStr .= ' GROUP BY id ORDER BY population DESC, id LIMIT 100';
$cities = array();
foreach ($sql_params as $param) {
$params = array($param);
if (!empty($p_countryCode)) {
$params[] = (string) $p_countryCode;
}
$rows = $g_ado_db->GetAll($queryStr, $params);
foreach ((array) $rows as $row) {
$one_town_info = (array) $row;
$one_town_info['provider'] = 'GN';
$one_town_info['copyright'] = 'Data © GeoNames.org, CC-BY';
$cities[] = $one_town_info;
}
if (!empty($cities)) {
break;
}
}
return $cities;
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:39,代码来源:GeoNames.php
示例14: parseRow
/**
* Returns an event!
* @param <type> $dayName
* @param <type> $row
* @return <type>
*/
private static function parseRow($row)
{
$event = new WPlan_Event();
if ($row == "...") {
$event->empty = TRUE;
return $event;
}
$event->empty = FALSE;
$parts = explode(',', $row);
$i = 0;
foreach ($parts as $part) {
$part = trim($part);
switch ($i) {
case 0:
$times = WPlan::parseTimes($part);
$event->from = $times['from'];
$event->to = $times['to'];
break;
case 1:
$event->name = $part;
break;
case 2:
$sep = ' ';
if (strchr($part, '/')) {
$sep = '/';
}
$event->sensei = explode($sep, $part);
break;
default:
$event->info[] = $part;
}
$i += 1;
}
return $event;
}
开发者ID:vladdu,项目名称:weekplan,代码行数:41,代码来源:wplan.php
示例15: set_fromhost
function set_fromhost()
{
global $proxyIPs;
global $fullfromhost;
global $fromhost;
@($fullfromhost = $_SERVER["HTTP_X_FORWARDED_FOR"]);
if ($fullfromhost == "") {
@($fullfromhost = $_SERVER["REMOTE_ADDR"]);
$fromhost = $fullfromhost;
} else {
$ips = explode(",", $fullfromhost);
$c = count($ips);
if ($c > 1) {
$fromhost = trim($ips[$c - 1]);
if (isset($proxyIPs) && in_array($fromhost, $proxyIPs)) {
$fromhost = $ips[$c - 2];
}
} else {
$fromhost = $fullfromhost;
}
}
if ($fromhost == "") {
$fromhost = "127.0.0.1";
$fullfromhost = "127.0.0.1";
}
if (defined("IPV6_LEGACY_IPV4_DISPLAY")) {
if (strchr($fromhost, '.') && ($p = strrchr($fromhost, ':'))) {
$fromhost = substr($p, 1);
}
}
//sometimes,fromhost has strang space
bbs_setfromhost(trim($fromhost), trim($fullfromhost));
}
开发者ID:bianle,项目名称:www2,代码行数:33,代码来源:funcs.php
示例16: execute
public function execute()
{
if (!defined('WIKIHIERO_VERSION')) {
$this->error("Please install WikiHiero first!\n", true);
}
$wh_prefabs = "\$wh_prefabs = array(\n";
$wh_files = "\$wh_files = array(\n";
$imgDir = dirname(__FILE__) . '/img/';
if (is_dir($imgDir)) {
$dh = opendir($imgDir);
if ($dh) {
while (($file = readdir($dh)) !== false) {
if (stristr($file, WikiHiero::IMAGE_EXT)) {
list($width, $height, $type, $attr) = getimagesize($imgDir . $file);
$wh_files .= " \"" . WikiHiero::getCode($file) . "\" => array( {$width}, {$height} ),\n";
if (strchr($file, '&')) {
$wh_prefabs .= " \"" . WikiHiero::getCode($file) . "\",\n";
}
}
}
closedir($dh);
}
} else {
$this->error("Images directory {$imgDir} not found!\n", true);
}
$wh_prefabs .= ");";
$wh_files .= ");";
$file = fopen('data/tables.php', 'w+');
fwrite($file, "<?php\n\n");
fwrite($file, '// File created by generateTables.php version ' . WIKIHIERO_VERSION . "\n");
fwrite($file, '// ' . date('Y-m-d \\a\\t H:i') . "\n\n");
fwrite($file, "{$wh_prefabs}\n\n{$wh_files}\n\n{$this->moreTables}\n");
fclose($file);
$this->serialize();
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:35,代码来源:generateTables.php
示例17: highlight
function highlight($word, $s)
{
$text = '';
$s = split(' ', $s);
foreach ($s as $w) {
if ($w == $word) {
$text .= $w . ' ';
} elseif (strchr($w, '_') !== false) {
$text .= str_replace('_', ' ', $w) . ' ';
} else {
$ww = $w;
$ln = strlen($w);
if ($ln > 2) {
$tail = substr($w, -2);
if ($tail == "'s" || $tail == "'d") {
$ww = substr($w, 0, $ln - 2);
} else {
$tail = substr($w, -3);
if ($tail == "'ve" || $tail == "'ll" || $tail == "'re" || $tail == "'em") {
$ww = substr($w, 0, $ln - 3);
}
}
}
$text .= "<A HREF=\"javascript:show_word('" . $ww . "')\" class=\"normal\">" . $w . '</A> ';
}
}
return $text;
}
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:28,代码来源:contents.php
示例18: ShowCatalogueList
/**
* Show all catalogue
*
*/
function ShowCatalogueList()
{
global $db;
global $EDIT_DOMAIN, $HTTP_ROOT_PATH, $DOMAIN_NAME, $ADMIN_PATH, $ADMIN_TEMPLATE, $SUB_FOLDER;
$nc_core = nc_Core::get_object();
$all_sites = $nc_core->catalogue->get_all();
if (!empty($all_sites)) {
$td = "<td>";
echo "\n\t\t<form method='post' action='index.php'>\n\n\t\t<table border='0' cellpadding='0' cellspacing='0' width='99%' class='border-bottom'>\n\t\t<tr>\n\t\t<td>ID</td>\n\t\t<td width='60%'>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_SITE . "</td>\n\t\t<td>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_SUBSECTIONS . "</td>\n\t\t<td>\n\t\t <div class='icons icon_prior' title='" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_PRIORITY . "'></div></td>\n\t\t<td>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_GOTO . "</td>\n\t\t<td>\n\t\t <div class='icons icon_delete' title='" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_DELETE . "'></div></td>\n \t\t</tr>";
foreach ($all_sites as $site) {
print "<tr>";
print $td . (!$site['Checked'] ? "<font>" : "<font>") . $site['Catalogue_ID'] . "</font></td>";
print $td . "<a href='{$ADMIN_PATH}subdivision/full.php?CatalogueID={$site['Catalogue_ID']}'>" . (!$site['Checked'] ? "<font color='cccccc'>" : "<font>") . $site['Catalogue_Name'] . "</a></font></td>";
print $td . "<a href='" . $ADMIN_PATH . "subdivision/?CatalogueID=" . $site['Catalogue_ID'] . "'>" . (!$site['Checked'] ? "<font color=cccccc>" : "") . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_LIST . " (" . HighLevelChildrenNumber($site['Catalogue_ID']) . ")</a></td>\n";
print "<td>" . nc_admin_input_simple("Priority" . $site['Catalogue_ID'], $site['Priority'] ? $site['Priority'] : 0, 3, "class='s' maxlength='5'") . "</td>\n";
print "<td>";
//setup
print "<a href=index.php?phase=2&CatalogueID=" . $site['Catalogue_ID'] . "&type=2><div class='icons icon_settings" . (!$site['Checked'] ? "_disabled" : "") . "' title='" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_TOOPTIONS . "'></div></a>";
//edit
print !GetSubClassCount($site['Title_Sub_ID']) ? "<img src=" . $ADMIN_PATH . "images/emp.gif width=18 height=18 style='margin:0px 2px 0px 2px;'>" : "<a target=_blank href=http://" . $EDIT_DOMAIN . $SUB_FOLDER . $HTTP_ROOT_PATH . "?catalogue=" . $site['Catalogue_ID'] . "&sub=" . $site['Title_Sub_ID'] . (nc_strlen(session_id()) > 0 ? "&" . session_name() . "=" . session_id() . "" : "") . "><div class='icons icon_pencil" . (!$site['Checked'] ? "_disabled" : "") . "' title='" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_EDIT . "'></div></a>";
//browse
print "<a href=http://" . ($site['Domain'] ? strchr($site['Domain'], ".") ? $site['Domain'] : $site['Domain'] . "." . $DOMAIN_NAME : $DOMAIN_NAME) . $SUB_FOLDER . (nc_strlen(session_id()) > 0 ? "?" . session_name() . "=" . session_id() . "" : "") . " target=_blank><div class='icons icon_preview" . (!$site['Checked'] ? "_disabled" : "") . "' title='" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_SHOW . "'></div></a>";
print "</td>";
print "<td>" . nc_admin_checkbox_simple("Delete" . $site['Catalogue_ID'], $site['Catalogue_ID']) . "</td>\n";
print "</tr>\n";
}
echo "\n \t\t</table>\n\t\t<br />\n " . $nc_core->token->get_input() . "\n \t\t<input type=hidden name=phase value='4' />\n \t\t<input class='hidden' type='submit' />\n \t\t</form>\n\t ";
} else {
echo CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_NONE . "<br /><br />";
}
return 0;
}
开发者ID:Blu2z,项目名称:implsk,代码行数:36,代码来源:function.inc.php
示例19: fileUpload
public function fileUpload(Request $request)
{
// return ($request->file('photo')->getMimeType());
if ($request->hasFile('photo')) {
$messages = ['photo.image' => '上传文件必须是图片', 'photo.max' => '上传文件不能大于:maxkb'];
$this->validate($request, ['photo' => 'image|max:500'], $messages);
if ($request->file('photo')->isValid()) {
$file_pre = getdate()[0];
//取得当前时间戳
$file_suffix = substr(strchr($request->file('photo')->getMimeType(), "/"), 1);
//取得文件后缀
$destinationPath = 'uploads';
//上传路径
$fileName = $file_pre . '.' . $file_suffix;
//上传文件名
$request->file('photo')->move($destinationPath, $fileName);
$img = new Img();
$img->name = $fileName;
$img->save();
Session()->flash('img', $fileName);
// return view('/admin/fileselect');
return $fileName;
} else {
return "上传文件无效!";
}
} else {
return "文件上传失败!";
}
}
开发者ID:goyuquan,项目名称:laravel_git,代码行数:29,代码来源:adminArticleController.php
示例20: Corrida
function Corrida($txt_numero)
{
$corrida = array();
if (strlen(strchr($txt_numero, '-')) > 0) {
$numeros = explode('-', $txt_numero);
$numero1 = $numeros[0];
$numero2 = $numeros[1];
$diferencia = $numero1 - $numero2;
if ($numero1 > 0 && $numero2 > 0) {
$cadena = '';
$flag = false;
if ($diferencia < 0) {
$diferencia = $diferencia * -1;
$flag = true;
}
for ($i = 0; $i <= $diferencia; $i++) {
if ($flag) {
$cadena = $numero1 + $i;
$corrida[] = $cadena;
} else {
$cadena = $numero2 + $i;
$corrida[] = $cadena;
}
}
return $corrida;
} else {
return $txt_numero;
}
} else {
return $txt_numero;
}
}
开发者ID:rogerapras,项目名称:lottomax,代码行数:32,代码来源:corrida.php
注:本文中的strchr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论