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

PHP endswith函数代码示例

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

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



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

示例1: list_zip_files

function list_zip_files($id)
{
    if (!($r = open_zip_archive($id))) {
        return false;
    }
    $zip = $r["handle"];
    $result = array();
    $idx = 0;
    while ($entry = zip_read($zip)) {
        $path = zip_entry_name($entry);
        $components = explode("/", $path);
        $filename = $components[count($components) - 1];
        /*
         * Remove
         * - filenames that begin with .
         * - .class
         * - .prefs
         * - paths ending with / (directory names)
         * - paths that contain .metadata
         */
        if (substr($filename, 0, 1) != "." && !endswith($filename, ".class") && !endswith($filename, ".prefs") && !endswith($path, "/") && strpos($path, ".metadata") === FALSE) {
            $result[$idx] = $filename;
        }
        $idx++;
    }
    zip_close($zip);
    return $result;
}
开发者ID:inscriptionweb,项目名称:Envoi,代码行数:28,代码来源:ziptools.php


示例2: initialize

 function initialize()
 {
     $dir = opendir(dirname(__FILE__) . '/classes');
     $this->field_types = array();
     while ($filespec = readdir($dir)) {
         if (!endswith($filespec, '.php')) {
             continue;
         }
         if (strpos($filespec, 'Field') === false && strpos($filespec, 'Disposition') === false) {
             continue;
         }
         $shortname = substr($filespec, 0, strpos($filespec, '.'));
         if (substr($shortname, -4) == 'Base') {
             continue;
         }
         $this->field_types[$this->Lang('field_type_' . $shortname)] = $shortname;
     }
     foreach ($this->field_types as $tName => $tType) {
         if (substr($tType, 0, 11) == 'Disposition') {
             $this->disp_field_types[$tName] = $tType;
         }
     }
     $this->all_validation_types = array();
     ksort($this->field_types);
     $this->std_field_types = array($this->Lang('field_type_TextField') => 'TextField', $this->Lang('field_type_TextAreaField') => 'TextAreaField', $this->Lang('field_type_CheckboxField') => 'CheckboxField', $this->Lang('field_type_CheckboxGroupField') => 'CheckboxGroupField', $this->Lang('field_type_PulldownField') => 'PulldownField', $this->Lang('field_type_RadioGroupField') => 'RadioGroupField', $this->Lang('field_type_DispositionEmail') => 'DispositionEmail', $this->Lang('field_type_DispositionFile') => 'DispositionFile', $this->Lang('field_type_PageBreakField') => 'PageBreakField', $this->Lang('field_type_StaticTextField') => 'StaticTextField');
     ksort($this->std_field_types);
 }
开发者ID:Alexkuva,项目名称:Beaupotager,代码行数:27,代码来源:FormBuilder.module.php


示例3: showFiles

function showFiles()
{
    echo "<h2>Icons</h2>\n";
    echo '<table border="1">';
    $list = array();
    $d = dir(".");
    while (false !== ($entry = $d->read())) {
        if (endswith($entry, ".gif") || endswith($entry, ".jpg") || endswith($entry, ".png") || endswith($entry, ".EPS") || endswith($entry, ".PSD") || endswith($entry, ".md")) {
            $list[] = $entry;
        }
    }
    $d->close();
    sort($list);
    foreach ($list as $entry) {
        echo '<tr>' . "\n";
        echo '<td><a href="' . $entry . '">' . $entry . ' </a></td>' . "\n";
        if (endswith($entry, ".gif") || endswith($entry, ".jpg") || endswith($entry, ".png")) {
            // display as image
            //   would be good to add a limiting size here
            echo '<td bgcolor="#C0C0C0"><a href="' . $entry . '"><img src="' . $entry . '" style="max-width:500px;max-height:500px;"></a></tr>' . "\n";
        } else {
            // link without display
            echo '<td bgcolor="#C0C0C0"><a href="' . $entry . '" download="' . $entry . '">(download)</a></tr>' . "\n";
        }
        echo '</tr>' . "\n";
    }
    echo "</table>\n";
}
开发者ID:AlanUS,项目名称:ALM_JMRI,代码行数:28,代码来源:showIcons.php


示例4: getFirstFileIn

function getFirstFileIn($dir)
{
    global $filetype;
    if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
            if (endswith($file, $filetype)) {
                return $file;
            }
        }
    }
    return false;
}
开发者ID:NoUsername,项目名称:SoftwareArchitecture,代码行数:12,代码来源:index.php


示例5: GetCachePath

 public static function GetCachePath($mod)
 {
     // Récupérer et traiter la préférence du dossier
     $cache_path = $mod->GetPreference("cache_path");
     // Si la préférence commence par un "/" alors l'enlever
     if (startswith($cache_path, DIRECTORY_SEPARATOR)) {
         $cache_path = substr($cache_path, 1);
     }
     // Si la préférence termine par un "/" alors l'enlever
     if (endswith($cache_path, DIRECTORY_SEPARATOR)) {
         $cache_path = substr($cache_path, -1, 1);
     }
     // Ajouter à la préférence le chemin complet
     $config = $mod->GetConfig();
     $cache_path = $config['root_path'] . DIRECTORY_SEPARATOR . "tmp" . DIRECTORY_SEPARATOR . $cache_path;
     return $cache_path;
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:17,代码来源:class.te_base.php


示例6: process_template

 /**
  * Process the specififed template through smarty.
  * This method will attempt to find the current action module, and given that and the name of the template find the template contents.
  * if the template name ends with .tpl a module file template is assumed.  Otherwise, a module database template will be assumed.
  * If a module cannot be determined, then a file template is assumed, using the 'file' smarty resource.
  *
  * @param string $tpl The name of the template to process.
  */
 protected function process_template($tpl)
 {
     $smarty = cmsms()->GetSmarty();
     $actionmodule = $smarty->get_template_vars('actionmodule');
     if ($actionmodule) {
         $mod = \cms_utils::get_module($actionmodule);
         if (is_object($mod)) {
             if (endswith($tpl, '.tpl')) {
                 $out = $mod->ProcessTemplate($tpl);
             } else {
                 $out = $mod->ProcessTemplateFromDatabase($tpl);
             }
         }
     } else {
         $out = $smarty->fetch('file:' . $tpl);
     }
     return $out;
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:26,代码来源:class.formatted_report_generator.php


示例7: showFiles

function showFiles()
{
    echo "<h2>Icons</h2>\n";
    echo '<table border="1">';
    $list = array();
    $d = dir(".");
    while (false !== ($entry = $d->read())) {
        if (endswith($entry, ".gif") || endswith($entry, ".jpg") || endswith($entry, ".png")) {
            $list[] = $entry;
        }
    }
    $d->close();
    sort($list);
    foreach ($list as $entry) {
        echo '<tr><td>' . $entry . ' </td><td bgcolor="#C0C0C0"><a href="' . $entry . '"><img src="' . $entry . '"></a></td>' . "\n";
    }
    echo "</table>\n";
}
开发者ID:NomDInet,项目名称:JMRI,代码行数:18,代码来源:showIcons.php


示例8: sendAsHtml

function sendAsHtml()
{
    global $filetype;
    if ($handle = opendir('./')) {
        /* This is the correct way to loop over the directory. */
        $first = true;
        $i = 1;
        while (false !== ($file = readdir($handle))) {
            if (endswith($file, $filetype)) {
                if (!$first) {
                    echo ' - ';
                } else {
                    $first = false;
                }
                echo "<a href=\"./{$file}\">Page {$i}</a> ";
                $i++;
            }
        }
        closedir($handle);
    }
}
开发者ID:NoUsername,项目名称:SoftwareArchitecture,代码行数:21,代码来源:linkprovider.php


示例9: build

	private function build($type,$id){
		
		if(endswith($type,"s")){
			$table = $type;
			$name =  substr($type,0,-1);
		}else{
			$table = $type."s";
			$name = $type;
		}
		
		$rows = $this->db->get_where($table,array("element_id"=>$id));
		if(rows($rows)){
			$out = array();
			foreach($rows->result_array() as $curRow){
				$out[$curRow['id']] = new $name( $this->oh, $curRow['id']); 	
			}
			$this->objArrays[$table] = $out;
			return $out;
		}else
			return array();
		
	}
开发者ID:resnostyle,项目名称:xem,代码行数:22,代码来源:fullelement.php


示例10: testAllCases

 public function testAllCases()
 {
     $TEST_CASE_DIR = realpath(__DIR__ . '/cases');
     echo "Directory is " . $TEST_CASE_DIR;
     $dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($TEST_CASE_DIR));
     foreach ($dir as $name => $object) {
         if (!endswith($name, '.txt')) {
             continue;
         }
         //$this->assertEquals($this->fmt->parseFile($name), file_get_contents($name . '.fixed'));
         $lines1 = explode("\n", $this->fmt->parseFile($name));
         $lines2 = explode("\n", file_get_contents($name . '.fixed'));
         for ($l = 0; $l < count($lines1); $l++) {
             if (!($lines1[$l] == $lines2[$l])) {
                 $first = $lines1[$l];
                 $second = $lines2[$l];
                 $this->assertTrue(false, "Line {$l} in file {$name} is incorrect\n" . "expected: {$second}\n" . "actual: {$first}");
             }
             $this->assertEquals($lines1[$l], $lines2[$l]);
         }
     }
 }
开发者ID:bpicolo,项目名称:php-fmt,代码行数:22,代码来源:PhpAutoFormatterTest.php


示例11: is_valid_url

 /**
  * A utility function to test if the supplied url path is valid for the supplied content id
  *
  * @param string The partial url path to test
  * @return boolean
  */
 public static function is_valid_url($url, $content_id = '')
 {
     // check for starting or ending slashes
     if (startswith($url, '/') || endswith($url, '/')) {
         return FALSE;
     }
     // first check for invalid chars.
     $translated = munge_string_to_url($url, false, true);
     if (strtolower($translated) != strtolower($url)) {
         return FALSE;
     }
     cms_route_manager::load_routes();
     $route = cms_route_manager::find_match($url);
     if (!$route) {
         return TRUE;
     }
     if ($route->is_content()) {
         if ($content_id == '' || $route->get_content() == $content_id) {
             return TRUE;
         }
     }
     return FALSE;
 }
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:29,代码来源:class.content_assistant.php


示例12: is_valid_url

 /**
  * A utility function to test if the supplied url path is valid for the supplied content id
  *
  * @param string The partial url path to test
  * @return boolean
  */
 public static function is_valid_url($url, $content_id = '')
 {
     // check for starting or ending slashes
     if (startswith($url, '/') || endswith($url, '/')) {
         return FALSE;
     }
     // first check for invalid chars.
     // strip off any extension (that is like 5 chars or less)
     $pos = strrpos($url, '.');
     if ($pos !== FALSE) {
         // have an extension.
         $ext = substr($url, $pos + 1);
         if (strlen($ext) >= 5 || munge_string_to_url($ext, false, true) != strtolower($ext)) {
             return FALSE;
         }
         $tmp = substr($url, 0, $pos);
         if (munge_string_to_url($tmp, false, true) != strtolower($tmp)) {
             return FALSE;
         }
     } else {
         $translated = munge_string_to_url($url, false, true);
         if (strtolower($translated) != strtolower($url)) {
             return FALSE;
         }
     }
     cms_route_manager::load_routes();
     $route = cms_route_manager::find_match($url, TRUE);
     if (!$route) {
         return TRUE;
     }
     if ($route->is_content()) {
         if ($content_id == '' || $route->get_content() == $content_id) {
             return TRUE;
         }
     }
     return FALSE;
 }
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:43,代码来源:class.content_assistant.php


示例13: includeType

 /**
  * Ensure that a given type is actually included
  *
  * @param string $class
  */
 public function includeType($class)
 {
     if (empty($class)) {
         throw new Exception("Cannot include null type");
     }
     $class = str_replace('.', '_', $class);
     $dir = 'model';
     $file = $class . '.php';
     $source = $dir . DIRECTORY_SEPARATOR . $file;
     $found = false;
     if (!Zend_Loader::isReadable($source)) {
         $extensions = array_merge(array('november'), za()->getExtensions());
         foreach ($extensions as $extDir) {
             $source = $extDir . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . $file;
             if (Zend_Loader::isReadable($source)) {
                 $found = true;
                 break;
             }
         }
     } else {
         $found = true;
     }
     if (!$found && endswith($class, 'Version')) {
         // try including the non-version instance instead
         return $this->includeType(substr($class, 0, strrpos($class, 'Version')));
     }
     try {
         if (!class_exists($class, false)) {
             Zend_Loader::loadFile(basename($source), APP_DIR . DIRECTORY_SEPARATOR . dirname($source), true);
         }
     } catch (Zend_Exception $ze) {
         // ignore it, we'll just assume it was loaded elsewhere
     }
     if (!class_exists($class)) {
         throw new Exception("Class {$class} not found in the model directory");
     }
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:42,代码来源:TypeManager.php


示例14: get_output

 /**
  * Get the output of the report.
  *
  * @return mixed the actual output format depends upon the template that is provided.
  */
 public function get_output()
 {
     $out = null;
     $data = parent::get_output();
     if (!is_array($data)) {
         return $out;
     }
     $smarty = cmsms()->GetSmarty();
     $smarty->assign('report_data', $data);
     $actionmodule = $smarty->get_template_vars('actionmodule');
     if ($actionmodule) {
         $mod = cms_utils::get_module($actionmodule);
         if (is_object($mod)) {
             if (endswith($this->get_template(), '.tpl')) {
                 $out = $mod->ProcessTemplate($this->get_template());
             } else {
                 $out = $mod->ProcessTemplateFromDatabase($this->get_template());
             }
         }
     } else {
         $out = $smarty->fetch('file:' . $template);
     }
     return $out;
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:29,代码来源:class.template_report_generator.php


示例15: __construct

 function __construct(&$content_obj, $params = array())
 {
     $params['block_type'] = 'date';
     parent::__construct($content_obj, $params);
     $showClock = !(isset($params['show_clock']) && ac_utils::IsFalse($params['show_clock']));
     $mode = 'calendar';
     if (isset($params['mode']) && strtolower($params['mode']) == 'dropdown') {
         $mode = 'dropdown';
     }
     $show24h = !(isset($params['show24h']) && ac_utils::IsFalse($params['show24h']));
     $dateFormat = isset($params['date_format']) ? $params['date_format'] : '%x %X';
     $startHour = 0;
     $endHour = 23;
     if (isset($params['start_hour'])) {
         if (endswith($params['start_hour'], 'pm')) {
             $params['start_hour'] = trim(str_ireplace('pm', '', $params['start_hour'])) + 12;
         } else {
             $params['start_hour'] = trim(str_ireplace(array('am', 'pm'), '', $params['start_hour']));
         }
         if ($params['start_hour'] > 0 && $params['start_hour'] <= $endHour) {
             $startHour = trim($params['start_hour']);
         }
     }
     if (isset($params['end_hour'])) {
         if (endswith($params['end_hour'], 'pm')) {
             $params['end_hour'] = trim(str_ireplace('pm', '', $params['end_hour'])) + 12;
         } else {
             $params['end_hour'] = trim(str_ireplace(array('am', 'pm'), '', $params['end_hour']));
         }
         if ($params['end_hour'] >= 0 && $params['end_hour'] < $endHour) {
             $endHour = trim($params['end_hour']);
         }
     }
     if ($endHour < $startHour) {
         $endHour = $startHour;
     }
     $startMinute = 0;
     if (isset($params['start_minute']) && $params['start_minute'] > 0 && $params['start_minute'] <= 59) {
         $startMinute = trim($params['start_minute']);
     }
     $endMinute = 59;
     if (isset($params['end_minute']) && $params['end_minute'] >= 0 && $params['end_minute'] < 59) {
         $endMinute = trim($params['end_minute']);
     }
     if ($endMinute < $startMinute) {
         $endMinute = $startMinute;
     }
     $startSecond = 0;
     if (isset($params['start_second']) && $params['start_second'] > 0 && $params['start_second'] <= 59) {
         $startSecond = trim($params['start_second']);
     }
     $endSecond = 59;
     if (isset($params['end_second']) && $params['end_second'] >= 0 && $params['end_second'] < 59) {
         $endSecond = trim($params['end_second']);
     }
     if ($endSecond < $startSecond) {
         $endSecond = $startSecond;
     }
     $stepHours = 1;
     if (isset($params['step_hours']) && $params['step_hours'] > 0 && $params['step_hours'] <= $endHour - $startHour) {
         $stepHours = trim($params['step_hours']);
     } else {
         if (isset($params['step_hours']) && $params['step_hours'] > 0 && $params['step_hours'] >= $endHour - $startHour) {
             $stepHours = $endHour - $startHour;
         }
     }
     $stepMinutes = 30;
     if (isset($params['step_minutes']) && $params['step_minutes'] > 0 && $params['step_minutes'] <= $endMinute - $startMinute) {
         $stepMinutes = trim($params['step_minutes']);
     } else {
         if (isset($params['step_minutes']) && $params['step_minutes'] > 0 && $params['step_minutes'] >= $endMinute - $startMinute) {
             $stepMinutes = $endMinute - $startMinute;
         }
     }
     $stepSeconds = 1;
     if (isset($params['step_seconds']) && $params['step_seconds'] > 0 && $params['step_seconds'] <= $endSecond - $startSeconds) {
         $stepSeconds = trim($params['step_seconds']);
     } else {
         if (isset($params['step_seconds']) && $params['step_seconds'] > 0 && $params['step_seconds'] >= $endSecond - $startSeconds) {
             $stepSeconds = $endSecond - $startSeconds;
         }
     }
     $this->SetProperty('show24h', $show24h);
     $this->SetProperty('mode', $mode);
     $this->SetProperty('start_hour', $startHour);
     $this->SetProperty('end_hour', $endHour);
     $this->SetProperty('start_minute', $startMinute);
     $this->SetProperty('end_minute', $endMinute);
     $this->SetProperty('start_second', $startSecond);
     $this->SetProperty('end_second', $endSecond);
     $this->SetProperty('step_hours', $stepHours);
     $this->SetProperty('step_minutes', $stepMinutes);
     $this->SetProperty('step_seconds', $stepSeconds);
     $this->SetProperty('show_clock', $showClock);
     $this->SetProperty('date_format', $dateFormat);
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:96,代码来源:class.acBlockType_date.php


示例16: cms_stylesheet_toString

function cms_stylesheet_toString($filename, $media_query = '', $media_type = '', $root_url, &$stylesheet, &$params)
{
    if (!endswith($root_url, '/')) {
        $root_url .= '/';
    }
    if (isset($params['nolinks'])) {
        $stylesheet .= $root_url . $filename . ',';
    } else {
        if (!empty($media_query)) {
            $stylesheet .= '<link rel="stylesheet" type="text/css" href="' . $root_url . $filename . '" media="' . $media_query . '" />' . "\n";
        } elseif (!empty($media_type)) {
            $stylesheet .= '<link rel="stylesheet" type="text/css" href="' . $root_url . $filename . '" media="' . $media_type . '" />' . "\n";
        } else {
            $stylesheet .= '<link rel="stylesheet" type="text/css" href="' . $root_url . $filename . '" />' . "\n";
        }
    }
}
开发者ID:Alexkuva,项目名称:Beaupotager,代码行数:17,代码来源:function.cms_stylesheet.php


示例17: gt_restrict_admin_with_redirect

function gt_restrict_admin_with_redirect()
{
    function endswith($string, $test)
    {
        $strlen = strlen($string);
        $testlen = strlen($test);
        if ($testlen > $strlen) {
            return false;
        }
        return substr_compare($string, $test, -$testlen) === 0;
    }
    //Get current user's role
    global $current_user;
    $user_roles = $current_user->roles;
    $user_role = array_shift($user_roles);
    if (is_admin() && $user_role == 'theme_options_preview' && !endswith($_SERVER['PHP_SELF'], '/wp-admin/admin-ajax.php') && !endswith($_SERVER['PHP_SELF'], '/includes/gt-customize.php')) {
        wp_redirect(site_url());
        exit;
    }
}
开发者ID:rubelmiah,项目名称:GT-Theme-Customizer-Preview,代码行数:20,代码来源:gt-custom.php


示例18: debug_buffer

<?php

if (!isset($gCms)) {
    exit;
}
debug_buffer('', 'Start of Menu Manager Display');
$hm =& $gCms->GetHierarchyManager();
$usefile = true;
$tpl_name = $this->GetPreference('default_template', 'simple_navigation.tpl');
if (isset($params['template']) && $params['template'] != '') {
    $tpl_name = $params['template'];
}
if (endswith($tpl_name, '.tpl')) {
    $usefile = true;
} else {
    $usefile = false;
}
$mdid = md5($gCms->variables['content_id'] . implode('|', $params));
$deep = 1;
if (isset($params['loadprops']) && $params['loadprops'] == 0) {
    $deep = 0;
}
$cached = false;
$origdepth = 0;
if (!$cached) {
    $nodelist = array();
    $count = 0;
    $getchildren = true;
    $rootnode = null;
    $prevdepth = 1;
    if (isset($params['childrenof'])) {
开发者ID:rasomu,项目名称:chuza,代码行数:31,代码来源:action.default.php


示例19: checkReferences

 function checkReferences($refs)
 {
     $messages = array();
     foreach ($refs as $r) {
         //echo $r . '----';
         if (trim($r) != "") {
             if (contains($r, "[")) {
                 $this->checkArray($r, $messages);
                 $r = str_replace("[", "||", $r);
                 $r = str_replace("]", "||", $r);
                 $r = str_replace(".", "||", $r);
                 $r = str_replace(",", "||", $r);
                 $r = str_replace(" ", "", $r);
                 // replace any operators
                 $r = str_replace("-", "||", $r);
                 $r = str_replace("+", "||", $r);
                 $r = str_replace("*", "||", $r);
                 $r = str_replace("/", "||", $r);
                 $explode = explode("||", $r);
                 foreach ($explode as $e) {
                     if (trim($e) != "") {
                         if (!is_numeric($e)) {
                             // check for _1_ for set of enum
                             $v = $this->survey->getVariableDescriptiveByName(getBasicName($e));
                             if (inArray($v->getAnswerType(), array(ANSWER_TYPE_SETOFENUMERATED, ANSWER_TYPE_MULTIDROPDOWN))) {
                                 $e = preg_replace("/(_[0-9]+_(\\b|\\[)){1}/", "", $e);
                             }
                             // check for associative key
                             $e = str_replace('"', "'", $e);
                             if (startsWith($e, "'") && endswith($e, "'")) {
                             } else {
                                 if ($v->getVsid() == "") {
                                     $sec = $this->survey->getSectionByName($e);
                                     if ($sec->getSeid() == "") {
                                         $messages[] = Language::messageCheckerVariableNotExists($e);
                                     }
                                 }
                             }
                         }
                     }
                 }
             } else {
                 if (!is_numeric($r)) {
                     $v = $this->survey->getVariableDescriptiveByName(getBasicName($r));
                     if (inArray($v->getAnswerType(), array(ANSWER_TYPE_SETOFENUMERATED, ANSWER_TYPE_MULTIDROPDOWN))) {
                         $r = preg_replace("/(_[0-9]+_(\\b|\\[)){1}/", "", $r);
                     }
                     if ($v->getVsid() == "") {
                         $sec = $this->survey->getSectionByName($e);
                         if ($sec->getSeid() == "") {
                             $messages[] = Language::messageCheckerVariableNotExists($r);
                         }
                     } else {
                         $this->checkArray($r, $messages);
                     }
                 }
             }
         }
     }
     // return result
     return $messages;
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:62,代码来源:checker.php


示例20: foreach

	<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
	<form class="container">
		<div class="col-md-12" id="header">
			<div class="col-md-1" id="title"><a href="<?php 
echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
?>
" class="no-href">.Desktop<br><img src="images/hero-dots.png" width="84px" /></a></div>
			<div class="col-md-10" id="browser">
				<label class="col-md-3 text-right lowered" for="file-list">.desktop File: </label>
				<select id="file-list">
					<option value=''></option>
					<?php 
foreach ($files as $file) {
    if (endswith($file, '.desktop')) {
        $file = substr($file, 0, strpos($file, '.desk'));
        echo "<option value=\"{$file}\">{$file}</option>";
    }
}
?>
				</select>
				<button class="btn btn-save pushed-right hide" type="button" value="New" id="new-section" name="new-section" title="Add New Section"><span class="fa fa-clone"></span></button>
				<button class="btn btn-save pushed-right" type="button" value="Save" id="save" name="save" title="Save Changes"><span class="fa fa-floppy-o"></span> Save</button>
			</div>
			<div class="clearfix"></div>
		</div>

		<div class="col-md-12" id="guts"></div>
	</form>
	<a href="javascript:void(null)" id="btn-top-scroller" class="bluezed-scroll-top"><span class="glyphicon glyphicon-menu-up bluezed-scroll-top-circle"></span></a>
开发者ID:homebru,项目名称:Desktop,代码行数:31,代码来源:index.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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