本文整理汇总了PHP中left函数的典型用法代码示例。如果您正苦于以下问题:PHP left函数的具体用法?PHP left怎么用?PHP left使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了left函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainAutoLoader
function mainAutoLoader($class)
{
// Exceptions werden leicht besonders behandelt.
if (right($class, 9) === 'Exception') {
$file = DIAMONDMVC_ROOT . "/exceptions/{$class}.php";
} else {
$class = strToLower($class);
if (left($class, 10) === 'controller' and $class !== 'controller') {
$class = substr($class, 10);
$file = DIAMONDMVC_ROOT . "/controllers/{$class}.php";
} else {
if (left($class, 5) === 'model' and $class !== 'model') {
$class = substr($class, 5);
$file = DIAMONDMVC_ROOT . "/models/{$class}.php";
} else {
if (left($class, 6) === 'module' and $class !== 'module') {
$class = substr($class, 6);
$file = DIAMONDMVC_ROOT . "/modules/{$class}/{$class}.php";
} else {
$file = DIAMONDMVC_ROOT . "/lib/class_{$class}.php";
}
}
}
}
if (file_exists($file)) {
include_once $file;
}
}
示例2: autoloadFields
function autoloadFields($class)
{
if (strToLower(left($class, 5)) !== 'field') {
return;
}
require_once jailpath(DIAMONDMVC_ROOT . '/classes/fields', strToLower(substr($class, 5)) . '.php');
}
示例3: extractColors
function extractColors($Hexa)
{
if (strlen($Hexa) != 6) {
return array(0, 0, 0);
}
$R = hexdec(left($Hexa, 2));
$G = hexdec(mid($Hexa, 3, 2));
$B = hexdec(right($Hexa, 2));
return array($R, $G, $B);
}
示例4: generateDataString
protected function generateDataString($exclude = array())
{
$result = '';
foreach ($this->data as $key => $value) {
if (left($key, 7) === 'search-' and !in_array($key, $exclude)) {
$result .= ' data-' . $key . '="' . $value . '"';
}
}
return $result;
}
示例5: textFormat
function textFormat($arrayData, $maxchar)
{
$maxchar = 40;
$text = '';
foreach ($arrayData as $key => $val) {
$newval = number_format($val, 0, '', '.');
$space = $maxchar - (strlen($key) + strlen($newval) + 2);
$text .= left($key, strlen($key));
$text .= str_repeat(" ", $space);
$text .= right($newval, strlen($newval));
$text .= ",-";
$text .= "\r\n";
}
return $text;
}
示例6: getWhereAnd
function getWhereAnd($sql, $addSql)
{
$LCaseAddSql = '';
$AddType = '';
$s = '';
//追加SQl为空则退出
if (aspTrim($addSql) == '') {
$getWhereAnd = $sql;
return @$getWhereAnd;
}
if (inStr(lCase($sql), ' where ') > 0) {
$AddType = ' And ';
} else {
$AddType = ' Where ';
}
if ($addSql != '') {
$addSql = aspTrim($addSql);
$LCaseAddSql = lCase($addSql);
if (left($LCaseAddSql, 6) == 'order ' || left($LCaseAddSql, 6) == 'group ') {
$getWhereAnd = $sql . ' ' . $addSql;
return @$getWhereAnd;
//改进必需加空格,因为前面已经删除了20160115
} else {
if (left($LCaseAddSql, 6) == 'where ') {
$addSql = mid($addSql, 7, -1);
} else {
if (left($LCaseAddSql, 4) == 'and ') {
$addSql = mid($addSql, 5, -1);
}
}
}
//对where 改进 20160623
$s = lCase($addSql);
if ($s != 'and' && $s != 'or' && $s != 'where') {
$sql = $sql . $AddType . $addSql;
}
}
$getWhereAnd = $sql;
return @$getWhereAnd;
}
示例7: error_reporting
$showDateTo1 = $dp->show('dateto1');
$showDateFrom2 = $dp->show('datefrom2');
$showDateTo2 = $dp->show('dateto2');
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
//$log = new Log();
$s = new XoopsSecurity();
//$ctrl= new SelectCtrl();
$periodfromctrl = $simbizctrl->getSelectPeriod(0, 'N', "onchange=updatePeriodTo(reporttype.value)", "periodfrom_id");
$periodtoctrl = $simbizctrl->getSelectPeriod(0, 'N', "", "periodto_id");
//$yearfromctrl=$simbizctrl->getSelectFinancialYear(0,'N',"","financialyearfrom_id");
//$yeartoctrl=$simbizctrl->getSelectFinancialYear(0,'N',"","financialyearto_id");
if ($defaultDateSession == "") {
$defaultDateSession = date("Y-m-d", time());
}
$datefrom1 = left($defaultDateSession, 7) . "-01";
$dateto1 = getLastDayByMonth(left($defaultDateSession, 7));
$uid = $xoopsUser->getVar('uid');
$orgctrl = $ctrl->selectionOrg($uid, $defaultorganization_id, 'N', "", 'N');
echo <<<EOF
<script type='text/javascript'>
function validateForm(){
var datefrom1 = document.forms['frmincomestatementreport'].datefrom1.value;
var datefrom2= document.forms['frmincomestatementreport'].datefrom2.value;
var dateto1= document.forms['frmincomestatementreport'].dateto2.value;
var dateto2= document.forms['frmincomestatementreport'].dateto2.value;
var periodfrom_id= document.forms['frmincomestatementreport'].periodfrom_id.value;
var periodto_id= document.forms['frmincomestatementreport'].periodto_id.value;
var reporttype = document.forms['frmincomestatementreport'].reporttype.value;
示例8: replaceDim
function replaceDim($content)
{
$splStr = '';
$s = '';
$tempS = '';
$c = '';
$lCaseS = '';
$DimInTHNumb = '';
$splStr = aspSplit($content, ',');
foreach ($splStr as $key => $s) {
$s = aspTrim($s);
$lCaseS = lCase($s);
if ($s != '') {
//对变量中()处理,
if (inStr($s, '(') > 0) {
$s = mid($s, 1, inStr($s, '(') - 1);
}
$DimInTHNumb = inStr(lCase($GLOBALS['ReplaceDimList']), ',' . $lCaseS . '=');
//替换变量
if ($DimInTHNumb > 0) {
//替换变量
$tempS = mid($GLOBALS['ReplaceDimList'], $DimInTHNumb + 1, -1);
$tempS = mid($tempS, 1, inStr($tempS, ',') - 1);
$tempS = mid($tempS, inStr($tempS, '=') + 1, -1);
if (inStr($GLOBALS['FunDim'] . $GLOBALS['RootFunDim'], ',' . $tempS . ',') == false) {
$s = $tempS;
}
}
$c = $c . $s . ',';
}
}
if ($c != '') {
$c = left($c, len($c) - 1);
}
$replaceDim = $c;
return @$replaceDim;
}
示例9: dirname
}
include_once dirname(__FILE__) . "/ressources/class.templates.inc";
include_once dirname(__FILE__) . "/ressources/class.users.menus.inc";
include_once dirname(__FILE__) . "/ressources/class.miniadm.inc";
include_once dirname(__FILE__) . "/ressources/class.mysql.postfix.builder.inc";
include_once dirname(__FILE__) . "/ressources/class.squid.inc";
if (isset($_GET["content"])) {
content();
exit;
}
if (isset($_GET["messaging-right"])) {
messaging_right();
exit;
}
if (isset($_GET["left"])) {
left();
exit;
}
if (isset($_GET["proxy-settings"])) {
section_architecture_tabs();
exit;
}
if (isset($_GET["web-filtering"])) {
web_filtering();
exit;
}
if (isset($_GET["tasks"])) {
tasks();
exit;
}
if (isset($_GET["monitor"])) {
示例10: getHtmlValue
function getHtmlValue($content, $sType)
{
$i = '';
$endStr = '';
$s = '';
$labelName = '';
$startLabel = '';
$endLabel = '';
$LCaseEndStr = '';
$paramName = '';
$startLabel = '<';
$endLabel = '>';
for ($i = 1; $i <= len($content); $i++) {
$s = mid($content, $i, 1);
$endStr = mid($content, $i, -1);
if ($s == '<') {
if (inStr($endStr, '>') > 0) {
$s = mid($endStr, 1, inStr($endStr, '>'));
$i = $i + len($s) - 1;
$s = mid($s, 2, len($s) - 2);
$s = PHPTrim($s);
if (right($s, 1) == '/') {
$s = PHPTrim(left($s, len($s) - 1));
}
$endStr = right($endStr, len($endStr) - len($s) - 2);
//最后字符减去当前标签 -2是因为它有<>二个字符
//注意之前放在labelName下面
$labelName = mid($s, 1, inStr($s . ' ', ' ') - 1);
$labelName = lCase($labelName);
if ($labelName == 'title' && $sType == 'webtitle') {
$LCaseEndStr = lCase($endStr);
if (inStr($LCaseEndStr, '</title>') > 0) {
$s = mid($endStr, 1, inStr($LCaseEndStr, '</title>') - 1);
} else {
$s = '';
}
$getHtmlValue = $s;
return @$getHtmlValue;
} else {
if ($labelName == 'meta' && ($sType == 'webkeywords' || $sType == 'webdescription')) {
$LCaseEndStr = lCase($endStr);
$paramName = PHPTrim(lCase(getParamValue($s, 'name')));
if ('web' . $paramName == $sType) {
$getHtmlValue = getParamValue($s, 'content');
return @$getHtmlValue;
}
}
}
}
}
}
$getHtmlValue = '';
return @$getHtmlValue;
}
示例11: formatting
function formatting($content, $action)
{
$i = '';
$endStr = '';
$s = '';
$c = '';
$labelName = '';
$startLabel = '';
$endLabel = '';
$endLabelStr = '';
$nLevel = '';
$isYes = '';
$parentLableName = '';
$nextLableName = '';
//下一个标题名称
$isA = '';
//是否为A链接
$isTextarea = '';
//是否为多行输入文本框
$isScript = '';
//脚本语言
$isStyle = '';
//Css层叠样式表
$isPre = '';
//是否为pre
$startLabel = '<';
$endLabel = '>';
$nLevel = 0;
$action = '|' . $action . '|';
//层级
$isA = false;
$isTextarea = false;
$isScript = false;
$isStyle = false;
$isPre = false;
$content = replace(replace($content, vbCrlf(), chr(10)), vbTab(), ' ');
for ($i = 1; $i <= len($content); $i++) {
$s = mid($content, $i, 1);
$endStr = mid($content, $i, -1);
if ($s == '<') {
if (inStr($endStr, '>') > 0) {
$s = mid($endStr, 1, inStr($endStr, '>'));
$i = $i + len($s) - 1;
$s = mid($s, 2, len($s) - 2);
if (right($s, 1) == '/') {
$s = PHPTrim(left($s, len($s) - 1));
}
$endStr = right($endStr, len($endStr) - len($s) - 2);
//最后字符减去当前标签 -2是因为它有<>二个字符
//注意之前放在labelName下面
$labelName = mid($s, 1, inStr($s . ' ', ' ') - 1);
$labelName = lCase($labelName);
//call echo("labelName",labelName)
if ($labelName == 'a') {
$isA = true;
} else {
if ($labelName == '/a') {
$isA = false;
} else {
if ($labelName == 'textarea') {
$isTextarea = true;
} else {
if ($labelName == '/textarea') {
$isTextarea = false;
} else {
if ($labelName == 'script') {
$isScript = true;
} else {
if ($labelName == '/script') {
$isScript = false;
} else {
if ($labelName == 'style') {
$isStyle = true;
} else {
if ($labelName == '/style') {
$isStyle = false;
} else {
if ($labelName == 'pre') {
$isPre = true;
} else {
if ($labelName == '/pre') {
$isPre = false;
}
}
}
}
}
}
}
}
}
}
$endLabelStr = $endLabel;
$nextLableName = getHtmlLableName($endStr, 0);
//不为压缩HTML
if (inStr($action, '|ziphtml|') == false && $isPre == false) {
if ($isA == false) {
if (inStr('|a|strong|u|i|s|script|', '|' . $labelName . '|') == false && '/' . $labelName != $nextLableName && inStr('|/a|/strong|/u|/i|/s|/script|', '|' . $nextLableName . '|') == false) {
$endLabelStr = $endLabelStr . chr(10);
}
//.........这里部分代码省略.........
示例12: Find_Specific_Report_Paragraph
function Find_Specific_Report_Paragraph($phrase_to_look_for, $file, $pl1_name, $aspect, $pl2_name, $pl_pos, $pl_speed)
{
$string = "";
$len = strlen($phrase_to_look_for);
//put entire file contents into an array, line by line
$file_array = file($file);
// look through each line searching for $phrase_to_look_for
for ($i = 0; $i < count($file_array); $i++) {
if (left(trim($file_array[$i]), $len) == $phrase_to_look_for) {
$flag = 0;
while (trim($file_array[$i]) != "*") {
if ($flag == 0) {
if ($pl_speed < 0) {
//retrograde
$string .= "<b>" . $pl1_name . $aspect . $pl2_name . "</b> - " . $pl1_name . " (Rx) at " . Convert_Longitude($pl_pos) . "<br>";
} else {
$string .= "<b>" . $pl1_name . $aspect . $pl2_name . "</b> - " . $pl1_name . " at " . Convert_Longitude($pl_pos) . "<br>";
}
} else {
$string .= $file_array[$i];
}
$flag = 1;
$i++;
}
break;
}
}
return $string;
}
示例13: local_link
function local_link($id_art, $id_prop, $lg)
{
global $l;
$txt = "";
$values = val_prop($id_art, $id_prop);
$values = array_unique($values);
if (count($values) > 0) {
for ($i = 0; $i < count($values); $i++) {
if (isset($values[$i])) {
$site = loc_val($values[$i], $id_prop);
if (right($site, 1) == "/") {
$site = left($site, strlen($site) - 1);
}
if (strpos($site, "louvre")) {
$site = str_replace("www.", "", $site);
}
if ($site != "") {
if ($txt != "") {
$txt .= "</br>";
}
$txt .= "<b>" . label_item($values[$i], $lg) . "</b> : ";
/* Easter egg */
if ($lg == "mu") {
$txt .= "<a href=\"" . $site . "\" class=\"externe\">Houba</a>";
} else {
$txt .= "<a href=\"" . $site . "\" class=\"externe\">" . str_replace("http://", "", $site) . "</a>";
}
}
}
}
}
return $txt;
}
示例14: display
public function display($arraydata, $y_axis = 0, $fielddata = false, $maxheight = 0)
{
$this->Rotate($arraydata["rotation"]);
if ($arraydata["rotation"] != "") {
if ($arraydata["rotation"] == "Left") {
$w = $arraydata["width"];
$arraydata["width"] = $arraydata["height"];
$arraydata["height"] = $w;
$this->pdf->SetXY($this->pdf->GetX() - $arraydata["width"], $this->pdf->GetY());
} elseif ($arraydata["rotation"] == "Right") {
$w = $arraydata["width"];
$arraydata["width"] = $arraydata["height"];
$arraydata["height"] = $w;
$this->pdf->SetXY($this->pdf->GetX(), $this->pdf->GetY() - $arraydata["height"]);
} elseif ($arraydata["rotation"] == "UpsideDown") {
//soverflow"=>$stretchoverflow,"poverflow"
$arraydata["soverflow"] = true;
$arraydata["poverflow"] = true;
// $w=$arraydata["width"];
// $arraydata["width"]=$arraydata["height"];
//$arraydata["height"]=$w;
$this->pdf->SetXY($this->pdf->GetX() - $arraydata["width"], $this->pdf->GetY() - $arraydata["height"]);
}
}
if ($arraydata["type"] == "SetFont") {
$arraydata["font"] = strtolower($arraydata["font"]);
if (file_exists($fontfile) || $this->bypassnofont == false) {
$fontfile = $this->fontdir . '/' . $arraydata["font"] . '.php';
$this->pdf->SetFont($arraydata["font"], $arraydata["fontstyle"], $arraydata["fontsize"], $fontfile);
} else {
$arraydata["font"] = "freeserif";
if ($arraydata["fontstyle"] == "") {
$this->pdf->SetFont('freeserif', $arraydata["fontstyle"], $arraydata["fontsize"], $this->fontdir . '/freeserif.php');
} elseif ($arraydata["fontstyle"] == "B") {
$this->pdf->SetFont('freeserifb', $arraydata["fontstyle"], $arraydata["fontsize"], $this->fontdir . '/freeserifb.php');
} elseif ($arraydata["fontstyle"] == "I") {
$this->pdf->SetFont('freeserifi', $arraydata["fontstyle"], $arraydata["fontsize"], $this->fontdir . '/freeserifi.php');
} elseif ($arraydata["fontstyle"] == "BI") {
$this->pdf->SetFont('freeserifbi', $arraydata["fontstyle"], $arraydata["fontsize"], $this->fontdir . '/freeserifbi.php');
} elseif ($arraydata["fontstyle"] == "BIU") {
$this->pdf->SetFont('freeserifbi', "BIU", $arraydata["fontsize"], $this->fontdir . '/freeserifbi.php');
} elseif ($arraydata["fontstyle"] == "U") {
$this->pdf->SetFont('freeserif', "U", $arraydata["fontsize"], $this->fontdir . '/freeserif.php');
} elseif ($arraydata["fontstyle"] == "BU") {
$this->pdf->SetFont('freeserifb', "U", $arraydata["fontsize"], $this->fontdir . '/freeserifb.php');
} elseif ($arraydata["fontstyle"] == "IU") {
$this->pdf->SetFont('freeserifi', "IU", $arraydata["fontsize"], $this->fontdir . '/freeserifbi.php');
}
}
} elseif ($arraydata["type"] == "subreport") {
return $this->runSubReport($arraydata, $y_axis);
} elseif ($arraydata["type"] == "MultiCell") {
if ($fielddata == false) {
$this->checkoverflow($arraydata, $this->updatePageNo($arraydata["txt"]), '', $maxheight);
} elseif ($fielddata == true) {
$this->checkoverflow($arraydata, $this->updatePageNo($this->analyse_expression($arraydata["txt"], $arraydata["isPrintRepeatedValues"])), $maxheight);
}
} elseif ($arraydata["type"] == "SetXY") {
$this->pdf->SetXY($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis);
} elseif ($arraydata["type"] == "Cell") {
// print_r($arraydata);
// echo "<br/>";
$this->pdf->Cell($arraydata["width"], $arraydata["height"], $this->updatePageNo($arraydata["txt"]), $arraydata["border"], $arraydata["ln"], $arraydata["align"], $arraydata["fill"], $arraydata["link"] . "", 0, true, "T", $arraydata["valign"]);
} elseif ($arraydata["type"] == "Rect") {
if ($arraydata['mode'] == 'Transparent') {
$style = '';
} else {
$style = 'FD';
}
// $this->pdf->SetLineStyle($arraydata['border']);
$this->pdf->Rect($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $style, $arraydata['border'], $arraydata['fillcolor']);
} elseif ($arraydata["type"] == "RoundedRect") {
if ($arraydata['mode'] == 'Transparent') {
$style = '';
} else {
$style = 'FD';
}
//
// $this->pdf->SetLineStyle($arraydata['border']);
$this->pdf->RoundedRect($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $arraydata["radius"], '1111', $style, $arraydata['border'], $arraydata['fillcolor']);
} elseif ($arraydata["type"] == "Ellipse") {
//$this->pdf->SetLineStyle($arraydata['border']);
$this->pdf->Ellipse($arraydata["x"] + $arraydata["width"] / 2 + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis + $arraydata["height"] / 2, $arraydata["width"] / 2, $arraydata["height"] / 2, 0, 0, 360, 'FD', $arraydata['border'], $arraydata['fillcolor']);
} elseif ($arraydata["type"] == "Image") {
//echo $arraydata["path"];
$path = $this->analyse_expression($arraydata["path"]);
$imgtype = substr($path, -3);
$arraydata["link"] = $arraydata["link"] . "";
if ($imgtype == 'jpg' || right($path, 3) == 'jpg' || right($path, 4) == 'jpeg') {
$imgtype = "JPEG";
} elseif ($imgtype == 'png' || $imgtype == 'PNG') {
$imgtype = "PNG";
}
//echo $path;
if (file_exists($path) || left($path, 4) == 'http') {
//$path="/Applications/XAMPP/xamppfiles/simbiz/modules/simantz/images/modulepic.jpg";
// $path="/simbiz/images/pendingno.png";
if ($arraydata["link"] == "") {
$this->pdf->Image($path, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $imgtype, $arraydata["link"]);
} else {
//.........这里部分代码省略.........
示例15: startsWith
function startsWith($str, $check)
{
return left($str, strlen($check)) == $check;
}