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

PHP pos函数代码示例

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

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



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

示例1: fill

function fill($prefix, $listid)
{
    global $server_name, $tables, $table_prefix;
    # check for not too many
    $domain = getConfig("domain");
    $res = Sql_query("select count(*) from {$tables['user']}");
    $row = Sql_fetch_row($res);
    if ($row[0] > 50000) {
        error("Hmm, I think 50 thousand users is quite enough for a test<br/>This machine does need to do other things you know.");
        print '<script language="Javascript" type="text/javascript"> document.forms[0].output.value="Done. Now there are ' . $row[0] . ' users in the database";</script>' . "\n";
        return 0;
    }
    # fill the database with "users" who have any combination of attribute values
    $attributes = array();
    $res = Sql_query("select * from {$tables['attribute']} where type = \"select\" or type = \"checkbox\" or type=\"radio\"");
    $num_attributes = Sql_Affected_rows();
    $total_attr = 0;
    $total_val = 0;
    while ($row = Sql_fetch_array($res)) {
        array_push($attributes, $row["id"]);
        $total_attr++;
        $values[$row["id"]] = array();
        $res2 = Sql_query("select * from {$table_prefix}" . "listattr_" . $row["tablename"]);
        while ($row2 = Sql_fetch_array($res2)) {
            array_push($values[$row["id"]], $row2["id"]);
            $total_val++;
        }
    }
    $total = $total_attr * $total_val;
    if (!$total) {
        Fatal_Error("Can only do stress test when some attributes exist");
        return 0;
    }
    for ($i = 0; $i < $total; $i++) {
        $data = array();
        reset($attributes);
        while (list($key, $val) = each($attributes)) {
            $data[$val] = pos($values[$val]);
            if (!$data[$val]) {
                reset($values[$val]);
                $data[$val] = pos($values[$val]);
            }
            next($values[$val]);
        }
        $query = sprintf('insert into %s (email,entered,confirmed) values("testuser%s",now(),1)', $tables["user"], $prefix . '-' . $i . '@' . $domain);
        $result = Sql_query($query, 0);
        $userid = Sql_insert_id();
        if ($userid) {
            $result = Sql_query("replace into {$tables['listuser']} (userid,listid,entered) values({$userid},{$listid},now())");
            reset($data);
            while (list($key, $val) = each($data)) {
                if ($key && $val) {
                    Sql_query("replace into {$tables['user_attribute']} (attributeid,userid,value) values(" . $key . ",{$userid}," . $val . ")");
                }
            }
        }
    }
    return 1;
}
开发者ID:narareddy,项目名称:phplist3,代码行数:59,代码来源:stresstest.php


示例2: get_systable

function get_systable($s_systable)
{
    global $dbhandle;
    // get the field names and types
    $sql = 'SELECT RDB$RELATION_FIELDS.RDB$FIELD_NAME AS FNAME,' . ' RDB$RELATION_FIELDS.RDB$FIELD_POSITION,' . ' RDB$FIELD_TYPE AS FTYPE,' . ' RDB$FIELD_SUB_TYPE AS STYPE' . ' FROM RDB$RELATION_FIELDS, RDB$FIELDS' . ' WHERE RDB$RELATION_NAME=\'' . $s_systable['table'] . '\'' . ' AND RDB$FIELD_SOURCE=RDB$FIELDS.RDB$FIELD_NAME' . ' ORDER BY RDB$FIELD_POSITION';
    $res = fbird_query($dbhandle, $sql) or ib_error(__FILE__, __LINE__, $sql);
    $table = array();
    while ($row = fbird_fetch_object($res)) {
        $type = isset($row->FTYPE) ? $row->FTYPE : NULL;
        $stype = isset($row->STYPE) ? $row->STYPE : NULL;
        $table[trim($row->FNAME)]['type'] = get_datatype($type, $stype);
    }
    fbird_free_result($res);
    // get the table content
    $sql = 'SELECT *' . ' FROM ' . $s_systable['table'];
    if ($s_systable['sysdata'] == FALSE) {
        $fields = array_keys($table);
        $sql .= ' WHERE ' . pos($fields) . " NOT LIKE 'RDB\$%'" . ' AND ' . pos($fields) . " NOT LIKE 'TMP\$%'";
    }
    // handle the filter
    if (!empty($s_systable['ffield']) && in_array($s_systable['ffield'], array_keys($table))) {
        $sql .= $s_systable['sysdata'] == TRUE ? ' WHERE ' : ' AND ';
        switch ($s_systable['fvalue']) {
            case '':
                $sql .= $s_systable['ffield'] . ' IS NULL';
                break;
            case 'BLOB':
                if ($table[$s_systable['ffield']]['type'] == 'BLOB') {
                    $sql .= $s_systable['ffield'] . " IS NOT NULL";
                    break;
                }
            default:
                $sql .= $s_systable['ffield'] . "='" . $s_systable['fvalue'] . "'";
        }
    }
    if (!empty($s_systable['order'])) {
        $sql .= ' ORDER BY ' . $s_systable['order'] . ' ' . $s_systable['dir'];
    }
    $res = fbird_query($dbhandle, $sql) or ib_error(__FILE__, __LINE__, $sql);
    while ($row = fbird_fetch_object($res)) {
        foreach (array_keys($table) as $fname) {
            if ($row->{$fname} === 0) {
                $table[$fname]['col'][] = '0';
            } elseif (!isset($row->{$fname}) || empty($row->{$fname})) {
                $table[$fname]['col'][] = '&nbsp;';
            } elseif ($table[$fname]['type'] == 'BLOB') {
                $table[$fname]['col'][] = '<i>BLOB</i>';
            } else {
                $table[$fname]['col'][] = trim($row->{$fname});
            }
        }
    }
    fbird_free_result($res);
    return $table;
}
开发者ID:silvadelphi,项目名称:firebirdwebadmin,代码行数:55,代码来源:system_table.inc.php


示例3: startClass

 public function startClass($class, $definition)
 {
     $string = "<?php\nclass {$class}";
     if ($definition['extend']) {
         $string .= ' extends ' . pos($definition['extend']);
     }
     if ($definition['implement']) {
         $string .= ' implements ' . implode(',', $definition['implement']);
     }
     return $string . "{\n";
 }
开发者ID:shaunxcode,项目名称:PHOS,代码行数:11,代码来源:buildClass.php


示例4: _oneQuery

 protected function _oneQuery($id)
 {
     $primary = $this->info(self::PRIMARY);
     $select = $this->select();
     if (is_scalar($id)) {
         $id = array(pos($primary) => $id);
     }
     foreach ($primary as $p) {
         $select->where("`{$this->_name}`.`{$p}` = ?", $id);
     }
     return $select;
 }
开发者ID:html,项目名称:PI,代码行数:12,代码来源:Table.php


示例5: show_array

function show_array($array)
{
    $output = "";
    for (reset($array); $key = key($array), $pos = pos($array); next($array)) {
        if (is_array($pos)) {
            $output .= "{$key} : <ul>";
            $output .= show_array($pos);
            $output .= "</ul>";
        } else {
            $output .= "{$key} = {$pos} <br/>";
        }
    }
    return $output;
}
开发者ID:0h546f6f78696342756e4e59,项目名称:scripts,代码行数:14,代码来源:phorum_to_e107.php


示例6: tagVariableVar

 protected function tagVariableVar(&$token)
 {
     if (('}' === $this->prevType || T_VARIABLE === $this->prevType) && !in_array($this->penuType, array(T_NEW, T_OBJECT_OPERATOR, T_DOUBLE_COLON))) {
         $t =& $this->types;
         end($t);
         $i = key($t);
         if (T_VARIABLE === $this->prevType && '$' !== $this->penuType) {
             if ('$this' !== ($a = $this->texts[$i])) {
                 $this->texts[$i] = $this->varVarLead . $a . $this->varVarTail;
             }
         } else {
             if ('}' === $this->prevType) {
                 $a = 1;
                 $b = array($i, 0);
                 prev($t);
                 while ($a > 0 && null !== ($i = key($t))) {
                     if ('{' === $t[$i]) {
                         --$a;
                     } else {
                         if ('}' === $t[$i]) {
                             ++$a;
                         }
                     }
                     prev($t);
                 }
                 $b[1] = $i;
                 if ('$' !== prev($t)) {
                     return;
                 }
             } else {
                 $a = $b = 0;
             }
             do {
             } while ('$' === prev($t));
             if (in_array(pos($t), array(T_NEW, T_OBJECT_OPERATOR, T_DOUBLE_COLON))) {
                 return;
             }
             $a =& $this->texts;
             $b && ($a[$b[0]] = $a[$b[1]] = '');
             next($t);
             $a[key($t)] = $this->varVarLead;
             end($t);
             $a[key($t)] .= $this->varVarTail;
         }
     }
 }
开发者ID:nicolas-grekas,项目名称:Patchwork,代码行数:46,代码来源:FunctionShim.php


示例7: pos

/**
 * UTF-8 aware alternative to strpos.
 *
 * Find position of first occurrence of a string.
 * This will get alot slower if offset is used.
 *
 * @see http://www.php.net/strpos
 * @see utf8_strlen
 * @see utf8_substr
 *
 * @param string        $str    haystack
 * @param string        $needle needle (you should validate this with utf8_is_valid)
 * @param integer|false $offset offset in characters (from left)
 *
 * @return mixed integer position or false on failure
 */
function pos($str, $needle, $offset = false)
{
    if ($offset === false) {
        $ar = explode($needle, $str, 2);
        //if (count($ar) > 1)
        if (isset($ar[1])) {
            return len($ar[0]);
        }
        return false;
    }
    if (!is_int($offset)) {
        trigger_error('utf8_strpos: Offset must be an integer', E_USER_ERROR);
        return false;
    }
    $str = sub($str, $offset);
    if (($pos = pos($str, $needle)) !== false) {
        return $pos + $offset;
    }
    return false;
}
开发者ID:corpsee,项目名称:php-utf-8,代码行数:36,代码来源:native.php


示例8: write_error

} else {
    if ($upload) {
        if (!is_writable($dirPath)) {
            write_error("Error: cannot write to the specified directory.");
        } else {
            //if mulltipart mode and there is no file form field in request , then write error
            if ($isMultiPart && count($_FILES) <= 0) {
                write_error("No chunk for save.");
            }
            //if can't open file for append , then write error
            if (!($file = fopen($filePath, "a"))) {
                write_error("Can't open file for write.");
            }
            //logic to read and save chunk posted with multipart
            if ($isMultiPart) {
                $filearr = pos($_FILES);
                if (!($input = file_get_contents($filearr['tmp_name']))) {
                    write_error("Can't read from file.");
                } else {
                    if (!fwrite($file, $input)) {
                        write_error("Can't write to file.");
                    }
                }
            } else {
                $input = file_get_contents("php://input");
                if (!fwrite($file, $input)) {
                    write_error("Can't write to file.");
                }
            }
            fclose($file);
            //Upload complete if size of saved temp file >= size of source file.
开发者ID:alex-k,项目名称:velotur,代码行数:31,代码来源:chunkupload.php


示例9: replaceMacroVars

 function replaceMacroVars($branch, $vars)
 {
     $newBranch = array();
     foreach ($branch as $leaf) {
         if (is_array($leaf)) {
             if (pos($leaf) == 'unquote') {
                 $newBranch[] = $vars[$leaf[1]];
             } else {
                 if (pos($leaf) == 'unquotesplice') {
                     foreach ($vars[$leaf[1]] as $part) {
                         $newBranch[] = $part;
                     }
                 } else {
                     $newBranch[] = $this->replaceMacroVars($leaf, $vars);
                 }
             }
         } else {
             $newBranch[] = $leaf;
         }
     }
     return $newBranch;
 }
开发者ID:shaunxcode,项目名称:phlisp,代码行数:22,代码来源:reader.php


示例10: replace_symbol

 public static function replace_symbol($symbol)
 {
     $symbol = pos($symbol);
     return self::$symbols_hash[$symbol][array_rand(self::$symbols_hash[$symbol])];
 }
开发者ID:html,项目名称:stuff,代码行数:5,代码来源:randomizer.php


示例11: getAccessList

 function getAccessList($name, $selected = "private")
 {
     $arr = array("private" => "Private", "public" => "Global public", "group" => "Group public");
     if (ereg(",", $selected)) {
         $selected = "group";
     }
     $out = "<select name=\"{$name}\">\n";
     for (reset($arr); current($arr); next($arr)) {
         $out .= '<option value="' . key($arr) . '"';
         if ($selected == key($arr)) {
             $out .= " SELECTED";
         }
         $out .= ">" . pos($arr) . "</option>\n";
     }
     $out .= "</select>\n";
     return $out;
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:17,代码来源:class.sbox.inc.php


示例12: marc_select

 function marc_select($type, $name = 'mySelector', $selected = '', $onchange = '')
 {
     $source = new marc_list($type);
     if ($onchange) {
         $onchange = " onchange=\"{$onchange}\" ";
     }
     $this->display = "<select id='{$name}' name='{$name}' {$onchange} >";
     if ($selected) {
         foreach ($source->table as $value => $libelle) {
             if (!($value == $selected)) {
                 $tag = "<option value='{$value}'>";
             } else {
                 $tag = "<option value='{$value}' selected='selected' >";
             }
             $this->display .= "{$tag}{$libelle}</option>";
         }
     } else {
         // cirque à cause d'un bug d'IE
         reset($source->table);
         $this->display .= "<option value='" . key($source->table) . "' selected='selected' >";
         $this->display .= pos($source->table) . '</option>';
         while (next($source->table)) {
             $this->display .= "<option value='" . key($source->table) . "'>";
             $this->display .= pos($source->table) . '</option>';
         }
     }
     $this->display .= "</select>";
 }
开发者ID:bouchra012,项目名称:PMB,代码行数:28,代码来源:marc_table.class.php


示例13: _saveDbData

 /**
  * dbFormHandler::_saveData()
  *
  * Save the data into the database
  *
  * @param array $data: associative array with the fields => values which should be saved
  * @return int: the id which was used to save the record
  * @access private
  * @author Teye Heimans
  */
 function _saveDbData($data)
 {
     // get the not-null fields from the table
     $notNullFields = $this->_db->getNotNullFields($this->_table);
     // get the data which should be saved
     foreach ($data as $field => $value) {
         if (is_array($value)) {
             $value = implode(', ', $value);
         }
         // remove unneeded spaces
         $value = trim($value);
         // do we have to save the field ?
         if (!in_array($field, $this->_dontSave) && (!isset($this->_fields[$field]) || !method_exists($this->_fields[$field][1], 'getViewMode') || !$this->_fields[$field][1]->getViewMode())) {
             // is the value empty and it can contain NULL, then save NULL
             if ($value == '' && !in_array($field, $notNullFields)) {
                 $value = 'NULL';
                 $this->_sql[] = $field;
                 // overwrite the old value with the new one
                 $data[$field] = $value;
             }
         } else {
             unset($data[$field]);
         }
     }
     // get the column types of the fields
     $fields = $this->_db->getFieldTypes($this->_table);
     // walk all datefields
     foreach ($this->_date as $field) {
         // do we still have to convert the value ?
         if (isset($data[$field]) && $data[$field] != 'NULL') {
             // does the field exists in the table?
             if (isset($fields[$field])) {
                 // get the fields type
                 $type = strtolower($fields[$field][0]);
                 // is the field's type a date field ?
                 if (strpos(strtolower($type), 'date') !== false) {
                     // get the value from the field
                     list($y, $m, $d) = $this->_fields[$field][1]->getAsArray();
                     // are all fields empty ?
                     if (empty($d) && empty($m) && empty($y)) {
                         // save NULL if possible, otherwise 0000-00-00
                         if (in_array($field, $notNullFields)) {
                             // this field cannot contain NULL
                             $data[$field] = '0000-00-00';
                         } else {
                             $data[$field] = 'NULL';
                             $this->_sql[] = $field;
                         }
                     } else {
                         // make sure that there are values for each "field"
                         if ($d == '') {
                             $d = '00';
                         }
                         if ($m == '') {
                             $m = '00';
                         }
                         if ($y == '') {
                             $y = '0000';
                         }
                         //date('Y');
                         // save the value as date
                         $data[$field] = $this->_db->dbDate($y, $m, $d);
                         $this->_sql[] = $field;
                     }
                 }
             }
         }
     }
     // get the query
     $query = $this->_getQuery($this->_table, $data, $this->_sql, $this->edit, $this->_id);
     // for debugging.. die when we got the query
     //$this->dieOnQuery = true;
     if (isset($this->dieOnQuery) && $this->dieOnQuery) {
         echo "<pre>";
         echo $query;
         echo "</pre>";
         exit;
     }
     // make sure that there is something to save...
     if (!$query) {
         return 0;
     }
     // execute the query
     $sql = $this->_db->query($query);
     // query failed?
     if (!$sql) {
         trigger_error("Error, query failed!<br />\n" . "<b>Error message:</b> " . $this->_db->getError() . "<br />\n" . "<b>Query:</b> " . $query, E_USER_WARNING);
         return -1;
     } else {
         // is it an edit form ? Then return the known edit id's
//.........这里部分代码省略.........
开发者ID:reshadf,项目名称:RMProject,代码行数:101,代码来源:dbFormHandler.php


示例14: key

        for ($j = 1; $j <= 5; $j++) {
            $sql .= 'shoot' . $j;
            if ($j < 5) {
                $sql .= ' + ';
            }
        }
        $sql .= ' AS total FROM Societe_2016 WHERE id_shooter = ' . key($tab) . ' ORDER BY total DESC  LIMIT 0 , 1';
        $res = mysql_query($sql) or die('requete invalide');
        $n_passe = 1;
        //affichage des 3 passe concernée
        while ($data = mysql_fetch_array($res)) {
            echo '&nbsp;&nbsp;&nbsp;<strong>Total société:</strong>';
            $total_passe = 0;
            for ($j = 0; $j <= 5; $j++) {
                $sh = 'shoot' . $j;
                if (isset($data[$sh])) {
                    $total_passe += $data[$sh];
                }
            }
            $str = sprintf("%05s", $total_passe);
            echo str_replace('0', '&nbsp;', substr($str, 0, 3));
            echo substr($str, 3, 2);
            $n_passe++;
        }
        echo '&nbsp;&nbsp;&nbsp;<strong>Total :' . pos($tab) . '</strong>';
        echo '</div></div><br />';
        next($tab);
    }
}
echo '</page>';
mysql_close($base);
开发者ID:NevilleDubuis,项目名称:Ranking,代码行数:31,代码来源:abbaye.php


示例15: cluster

 /**
  * Constructor.
  *
  * @param $clusterdata int/object/array The data id of a data record or data elements to load manually.
  *
  */
 function cluster($clusterdata = false)
 {
     global $CURMAN;
     parent::datarecord();
     $this->set_table(CLSTTABLE);
     $this->add_property('id', 'int');
     $this->add_property('name', 'string');
     $this->add_property('display', 'string');
     $this->add_property('leader', 'int');
     $this->add_property('parent', 'int');
     $this->add_property('depth', 'int');
     if (is_numeric($clusterdata)) {
         $this->data_load_record($clusterdata);
     } else {
         if (is_array($clusterdata)) {
             $this->data_load_array($clusterdata);
         } else {
             if (is_object($clusterdata)) {
                 $this->data_load_array(get_object_vars($clusterdata));
             }
         }
     }
     if (!empty($this->id)) {
         // custom fields
         $level = context_level_base::get_custom_context_level('cluster', 'block_curr_admin');
         if ($level) {
             $fielddata = field_data::get_for_context(get_context_instance($level, $this->id));
             $fielddata = $fielddata ? $fielddata : array();
             foreach ($fielddata as $name => $value) {
                 $this->{"field_{$name}"} = $value;
             }
         }
     }
     /*
      * profile_field1 -select box
      * profile_value1 -select box corresponding to profile_field1
      *
      * profile_field2 -select box
      * profile_value2 -select box corresponding to profile_field2
      */
     $prof_fields = $CURMAN->db->get_records(CLSTPROFTABLE, 'clusterid', $this->id, '', '*', 0, 2);
     if (!empty($prof_fields)) {
         foreach (range(1, 2) as $i) {
             $profile = pos($prof_fields);
             if (!empty($profile)) {
                 $field = 'profile_field' . $i;
                 $value = 'profile_value' . $i;
                 $this->{$field} = $profile->fieldid;
                 $this->{$value} = $profile->value;
             }
             next($prof_fields);
         }
     }
 }
开发者ID:remotelearner,项目名称:elis.cm,代码行数:60,代码来源:cluster.class.php


示例16: ini_set

include_once 'dataQuery.php';
ini_set('auto_detect_line_endings', TRUE);
//deals with differing line ending
date_default_timezone_set('America/Edmonton');
// </n> in  linux and </lf /cr> in windows
$formatStr = "Y-m-d H:i:s";
$unixTime = time();
$date = new DateTime("@{$unixTime}");
$date = $date->format($formatStr);
$db;
$dir = '/opt/ZEUS/parsed_datalogs/sql_parsed/';
$files = scandir($dir, 1);
$files = preg_grep("/^.*\\.csv\$/", $files);
//removes all files from the array that do not end in *.csv
$files = $dir . pos($files);
echo $files;
if (($handle = fopen($files, "r")) !== FALSE) {
    //file exists
    $db = new Db();
    $sql = "INSERT INTO `DataSet`(`dataID`, `addedBy`, `raceID`, `datasetname`) VALUES ('NULL','1','3','{$date}');";
    $result = $db->query($sql);
    // echo $result."\n";
    $sql = "SELECT MAX(dataID) FROM DataSet;";
    $result = $db->query($sql);
    $maxId = mysqli_fetch_assoc($result);
    $max = $maxId["MAX(dataID)"];
    while (($data = fgetcsv($handle, 500, ",")) !== FALSE) {
        /* echo "Time is ".$data[0]."\n";
           echo "Acceleration is ". $data[1] ." M/s^2 \n";
           echo "Velocity is " .$data[2]." M/s \n";
开发者ID:UCalgaryZEUS,项目名称:ZEUS_Logging_Scripts,代码行数:30,代码来源:file-read.php


示例17: marc_select

 function marc_select($type, $name = 'mySelector', $selected = '', $onchange = '', $option_premier_code = '', $option_premier_info = '')
 {
     global $charset;
     $source = new marc_list($type);
     $source_tab = $source->table;
     if ($option_premier_code !== '' && $option_premier_info !== '') {
         $option_premier_tab = array($option_premier_code => $option_premier_info);
         $source_tab = $option_premier_tab + $source_tab;
     }
     if ($onchange) {
         $onchange = " onchange=\"{$onchange}\" ";
     }
     $this->display = "<select id='{$name}' name='{$name}' {$onchange} >";
     if ($selected) {
         foreach ($source_tab as $value => $libelle) {
             if (!($value == $selected)) {
                 $tag = "<option value='{$value}'>";
             } else {
                 $tag = "<option value='{$value}' selected='selected'>";
                 $this->libelle = "{$libelle}";
             }
             $this->display .= $tag . htmlentities($libelle, ENT_QUOTES, $charset) . "</option>";
         }
     } else {
         // cirque à cause d'un bug d'IE
         reset($source_tab);
         $this->display .= "<option value='" . key($source_tab) . "' selected='selected'>";
         $this->display .= htmlentities(pos($source_tab), ENT_QUOTES, $charset) . '</option>';
         while (next($source_tab)) {
             $this->display .= "<option value='" . key($source_tab) . "'>";
             $this->display .= htmlentities(pos($source_tab), ENT_QUOTES, $charset) . '</option>';
         }
     }
     $this->display .= "</select>";
 }
开发者ID:hogsim,项目名称:PMB,代码行数:35,代码来源:marc_table.class.php


示例18: function

    if (pos(buttontask, '.add') > 0) {
        JToolbarHelper::addNewX($buttons[0], $button[2]);
    } else {
        if (pos(buttontask, '.edit') > 0) {
            JToolbarHelper::editListX($buttons[0], $button[2]);
        } else {
            if (pos(buttontask, '.delete') > 0) {
                JToolbarHelper::deleteListX('', $buttons[0], $button[2]);
            } else {
                if (pos(buttontask, '.save') > 0) {
                    JToolbarHelper::save($buttons[0], $button[2]);
                } else {
                    if (pos(buttontask, '.cancel') > 0) {
                        JToolbarHelper::cancel($buttons[0], $button[2]);
                    } else {
                        if (pos(buttontask, '.back') > 0) {
                            JToolbarHelper::back($buttons[0], $button[2]);
                        } else {
                            JToolbarHelper::custom($buttons[0], $buttons[1], $buttons[2], false);
                        }
                    }
                }
            }
        }
    }
}
?>
 
<script language="javascript" type="text/javascript">
btnClixk = function(task) {
		document.forms.adminForm.task.value = task;
开发者ID:utopszkij,项目名称:keszlet,代码行数:31,代码来源:tmpl_show.php


示例19: array

}
if (in_array("55", $os, true)) {
    print "strict doesn't work";
}
// array_values
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
// current, pos, next, key, prev, end
reset($os);
print current($os);
print key($os);
next($os);
print pos($os);
print key($os);
print prev($os);
print pos($os);
print key($os);
print end($os);
print current($os);
print key($os);
while ($val = prev($os)) {
    echo "prev check: {$val}\n";
}
// array_reverse
$input = array('your' => "php", 'my' => 4.0, array("green", "red"));
$result = array_reverse($input);
$result_keyed = array_reverse($input, true);
var_dump($result);
var_dump($result_keyed);
// array_pop
$stack = array("orange", "banana", "apple", "raspberry");
开发者ID:jenalgit,项目名称:roadsend-php,代码行数:31,代码来源:array2.php


示例20: stripslashes

            $paidappfee = "off";
        }
        $data->adminEditUser($editview, $_REQUEST["editaccess"], $usrAccessid, $_REQUEST["email"], stripslashes($_REQUEST["firstname"]), stripslashes($_REQUEST["lastname"]), $_REQUEST["dob"], $_REQUEST["sex"], $_REQUEST["phone"], $_REQUEST["marital"], $_REQUEST["streetaddress"], $_REQUEST["city"], $_REQUEST["zip"], $_REQUEST["state"], $_REQUEST["country"], $_REQUEST["phone"], $_REQUEST["allergies"], $_REQUEST["medications"], $_REQUEST["notes"], $_REQUEST["insurance"], $_REQUEST["adminnotes"], $usr->groupid, $paidappfee, $_REQUEST["tshirt_size"]);
        if ($editview == $usr->userid) {
            $usr->firstname = $_REQUEST["firstname"];
            $usr->lastname = $_REQUEST["lastname"];
            $usr->email = $_REQUEST["email"];
            $usr->streetaddress = $_REQUEST["streetaddress"];
        }
        $smarty->assign('feedback', 'Profile information updated.');
    }
}
// Process Image
$newname = "";
if (count($_FILES) > 0) {
    $arrfile = pos($_FILES);
    $filename = basename($arrfile['name']);
    $ext = substr($filename, strrpos($filename, '.') + 1);
    if (strtolower($ext) == "jpg" || strtolower($ext) == "png" || strtolower($ext) == "bmp" || strtolower($ext) == "gif") {
        $newname = md5(microtime());
        $newpath = SYS_TIDIR . "/" . $newname . "." . $ext;
        if (!file_exists($newname)) {
            if (move_uploaded_file($arrfile['tmp_name'], $newpath)) {
                list($width, $height) = getimagesize($newpath);
                // Create Avatar
                $newname_resized = SYS_IDIR . "/" . $newname . "_avatar.jpg";
                $exec_command = "nice -n 19 " . SYS_CONVERT . " -size 100x100 -thumbnail 44x44^ -gravity center -extent 44x44 -quality 80 -density 88x88 +profile \"*\" {$newpath} {$newname_resized}";
                exec($exec_command);
                // Create profile picture
                $newname_resized = SYS_IDIR . "/" . $newname . "_profile.jpg";
                $exec_command = "nice -n 19 " . SYS_CONVERT . " -quality 75 -resize 600x600\\> -density 88x88 +profile \"*\" {$newpath} {$newname_resized}";
开发者ID:howardsalter,项目名称:OM_EP,代码行数:31,代码来源:page_profile.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP position函数代码示例发布时间:2022-05-15
下一篇:
PHP porto_vc_custom_class函数代码示例发布时间: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