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

PHP esquerda函数代码示例

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

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



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

示例1: fbarcode

function fbarcode($valor)
{
    $fino = 1;
    $largo = 3;
    $altura = 50;
    $barcodes[0] = "00110";
    $barcodes[1] = "10001";
    $barcodes[2] = "01001";
    $barcodes[3] = "11000";
    $barcodes[4] = "00101";
    $barcodes[5] = "10100";
    $barcodes[6] = "01100";
    $barcodes[7] = "00011";
    $barcodes[8] = "10010";
    $barcodes[9] = "01010";
    for ($f1 = 9; $f1 >= 0; $f1--) {
        for ($f2 = 9; $f2 >= 0; $f2--) {
            $f = $f1 * 10 + $f2;
            $texto = "";
            for ($i = 1; $i < 6; $i++) {
                $texto .= substr($barcodes[$f1], $i - 1, 1) . substr($barcodes[$f2], $i - 1, 1);
            }
            $barcodes[$f] = $texto;
        }
    }
    $tpl_bar->FINO = $fino;
    $tpl_bar->ALTURA = $altura;
    $texto = $valor;
    if (strlen($texto) % 2 != 0) {
        $texto = "0" . $texto;
    }
    while (strlen($texto) > 0) {
        $i = round(esquerda($texto, 2));
        $texto = direita($texto, strlen($texto) - 2);
        $f = $barcodes[$i];
        for ($i = 1; $i < 11; $i += 2) {
            if (substr($f, $i - 1, 1) == "0") {
                $f1 = $fino;
            } else {
                $f1 = $largo;
            }
            $tpl_bar->F1 = $f1;
            $tpl_bar->ALTURA = $altura;
            $tpl_bar->block("BLOCK_1");
            $tpl_bar->block("BLOCK_ITEM");
            if (substr($f, $i, 1) == "0") {
                $f2 = $fino;
            } else {
                $f2 = $largo;
            }
            $tpl_bar->F2 = $f2;
            $tpl_bar->ALTURA = $altura;
            $tpl_bar->block("BLOCK_2");
            $tpl_bar->block("BLOCK_ITEM");
        }
    }
    $tpl_bar->LARGO = $largo;
    $tpl_bar->FINO = $fino;
    $tpl_bar->LARGO = $fino;
}
开发者ID:mauriciowitzgall,项目名称:SGAF,代码行数:60,代码来源:codigo_barras2.php


示例2: fbarcode

function fbarcode($valor, $dir = "")
{
    $fino = 1;
    $largo = 3;
    $altura = 50;
    $barcodes[0] = "00110";
    $barcodes[1] = "10001";
    $barcodes[2] = "01001";
    $barcodes[3] = "11000";
    $barcodes[4] = "00101";
    $barcodes[5] = "10100";
    $barcodes[6] = "01100";
    $barcodes[7] = "00011";
    $barcodes[8] = "10010";
    $barcodes[9] = "01010";
    for ($f1 = 9; $f1 >= 0; $f1--) {
        for ($f2 = 9; $f2 >= 0; $f2--) {
            $f = $f1 * 10 + $f2;
            $texto = "";
            for ($i = 1; $i < 6; $i++) {
                $texto .= substr($barcodes[$f1], $i - 1, 1) . substr($barcodes[$f2], $i - 1, 1);
            }
            $barcodes[$f] = $texto;
        }
    }
    //Desenho da barra
    //Guarda inicial
    $home_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
    ?>
<img src=<?php 
    echo $home_url;
    ?>
lib/boleto_php/imagens/p.png width=<?php 
    echo $fino;
    ?>
 height=<?php 
    echo $altura;
    ?>
 border=0><img 
src=<?php 
    echo $home_url;
    ?>
lib/boleto_php/imagens/b.png width=<?php 
    echo $fino;
    ?>
 height=<?php 
    echo $altura;
    ?>
 border=0><img 
src=<?php 
    echo $home_url;
    ?>
lib/boleto_php/imagens/p.png width=<?php 
    echo $fino;
    ?>
 height=<?php 
    echo $altura;
    ?>
 border=0><img 
src=<?php 
    echo $home_url;
    ?>
lib/boleto_php/imagens/b.png width=<?php 
    echo $fino;
    ?>
 height=<?php 
    echo $altura;
    ?>
 border=0><img 
<?php 
    $texto = $valor;
    if (strlen($texto) % 2 != 0) {
        $texto = "0" . $texto;
    }
    // Draw dos dados
    while (strlen($texto) > 0) {
        $i = round(esquerda($texto, 2));
        $texto = direita($texto, strlen($texto) - 2);
        $f = $barcodes[$i];
        for ($i = 1; $i < 11; $i += 2) {
            if (substr($f, $i - 1, 1) == "0") {
                $f1 = $fino;
            } else {
                $f1 = $largo;
            }
            ?>
    src=<?php 
            echo $home_url;
            ?>
lib/boleto_php/imagens/p.png width=<?php 
            echo $f1;
            ?>
 height=<?php 
            echo $altura;
            ?>
 border=0><img 
<?php 
            if (substr($f, $i, 1) == "0") {
                $f2 = $fino;
            } else {
//.........这里部分代码省略.........
开发者ID:mvnp,项目名称:MageBR-Boleto_Bancario_Magento,代码行数:101,代码来源:funcoes_cef.php


示例3: fbarcode

function fbarcode($valor){

$fino = 1 ;
$largo = 3 ;
$altura = 50 ;

  $barcodes[0] = "00110" ;
  $barcodes[1] = "10001" ;
  $barcodes[2] = "01001" ;
  $barcodes[3] = "11000" ;
  $barcodes[4] = "00101" ;
  $barcodes[5] = "10100" ;
  $barcodes[6] = "01100" ;
  $barcodes[7] = "00011" ;
  $barcodes[8] = "10010" ;
  $barcodes[9] = "01010" ;
  for($f1=9;$f1>=0;$f1--){ 
    for($f2=9;$f2>=0;$f2--){  
      $f = ($f1 * 10) + $f2 ;
      $texto = "" ;
      for($i=1;$i<6;$i++){ 
        $texto .=  substr($barcodes[$f1],($i-1),1) . substr($barcodes[$f2],($i-1),1);
      }
      $barcodes[$f] = $texto;
    }
  }


//Desenho da barra


//Guarda inicial
?><img src=imagens/p.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
src=imagens/b.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
src=imagens/p.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
src=imagens/b.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
<?php
$texto = $valor ;
if((strlen($texto) % 2) <> 0){
	$texto = "0" . $texto;
}

// Draw dos dados
while (strlen($texto) > 0) {
  $i = round(esquerda($texto,2));
  $texto = direita($texto,strlen($texto)-2);
  $f = $barcodes[$i];
  for($i=1;$i<11;$i+=2){
    if (substr($f,($i-1),1) == "0") {
      $f1 = $fino ;
    }else{
      $f1 = $largo ;
    }
?>
    src=imagens/p.png width=<?php echo $f1?> height=<?php echo $altura?> border=0><img 
<?php
    if (substr($f,$i,1) == "0") {
      $f2 = $fino ;
    }else{
      $f2 = $largo ;
    }
?>
    src=imagens/b.png width=<?php echo $f2?> height=<?php echo $altura?> border=0><img 
<?php
  }
}

// Draw guarda final
?>
src=imagens/p.png width=<?php echo $largo?> height=<?php echo $altura?> border=0><img 
src=imagens/b.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
src=imagens/p.png width=<?php echo 1?> height=<?php echo $altura?> border=0> 
  <?php
} //Fim da função
开发者ID:rafaelferreiraxd,项目名称:modulos-magento,代码行数:74,代码来源:funcoes_sudameris.php


示例4: substr

         $f = $f1 * 10 + $f2;
         $texto = "";
         for ($i = 1; $i < 6; $i++) {
             $texto .= substr($barcodes[$f1], $i - 1, 1) . substr($barcodes[$f2], $i - 1, 1);
         }
         $barcodes[$f] = $texto;
     }
 }
 $tpl->FINO = $fino;
 $tpl->ALTURA = $altura;
 $texto = $valor;
 if (strlen($texto) % 2 != 0) {
     $texto = "0" . $texto;
 }
 while (strlen($texto) > 0) {
     $i = round(esquerda($texto, 2));
     $texto = direita($texto, strlen($texto) - 2);
     $f = $barcodes[$i];
     for ($i = 1; $i < 11; $i += 2) {
         if (substr($f, $i - 1, 1) == "0") {
             $f1 = $fino;
         } else {
             $f1 = $largo;
         }
         $tpl->F1 = $f1;
         $tpl->ALTURA = $altura;
         $tpl->block("BLOCK_1");
         $tpl->block("BLOCK_ITEM");
         if (substr($f, $i, 1) == "0") {
             $f2 = $fino;
         } else {
开发者ID:mauriciowitzgall,项目名称:SGAF,代码行数:31,代码来源:entradas_etiquetinha.php


示例5: fbarcode

function fbarcode($valor)
{
    $fino = 1;
    $largo = 3;
    $altura = 50;
    $barcodes[0] = "00110";
    $barcodes[1] = "10001";
    $barcodes[2] = "01001";
    $barcodes[3] = "11000";
    $barcodes[4] = "00101";
    $barcodes[5] = "10100";
    $barcodes[6] = "01100";
    $barcodes[7] = "00011";
    $barcodes[8] = "10010";
    $barcodes[9] = "01010";
    for ($f1 = 9; $f1 >= 0; $f1--) {
        for ($f2 = 9; $f2 >= 0; $f2--) {
            $f = $f1 * 10 + $f2;
            $texto = "";
            for ($i = 1; $i < 6; $i++) {
                $texto .= substr($barcodes[$f1], $i - 1, 1) . substr($barcodes[$f2], $i - 1, 1);
            }
            $barcodes[$f] = $texto;
        }
    }
    //Desenho da barra
    //Guarda inicial
    ?>
    <table border="0">
        <tr><td>
                <img src="../imagens/icones/codigo_barras/p.gif" width=<?php 
    echo $fino;
    ?>
 height=<?php 
    echo $altura;
    ?>
 border=0><img
                    src="../imagens/icones/codigo_barras/b.gif" width=<?php 
    echo $fino;
    ?>
 height=<?php 
    echo $altura;
    ?>
 border=0><img
                    src="../imagens/icones/codigo_barras/p.gif" width=<?php 
    echo $fino;
    ?>
 height=<?php 
    echo $altura;
    ?>
 border=0><img
                    src="../imagens/icones/codigo_barras/b.gif" width=<?php 
    echo $fino;
    ?>
 height=<?php 
    echo $altura;
    ?>
 border=0><img
                    <?php 
    $texto = $valor;
    if (strlen($texto) % 2 != 0) {
        $texto = "0" . $texto;
    }
    // Draw dos dados
    while (strlen($texto) > 0) {
        $i = round(esquerda($texto, 2));
        $texto = direita($texto, strlen($texto) - 2);
        $f = $barcodes[$i];
        for ($i = 1; $i < 11; $i += 2) {
            if (substr($f, $i - 1, 1) == "0") {
                $f1 = $fino;
            } else {
                $f1 = $largo;
            }
            ?>
                            src="../imagens/icones/codigo_barras/p.gif" width=<?php 
            echo $f1;
            ?>
 height=<?php 
            echo $altura;
            ?>
 border=0><img
                            <?php 
            if (substr($f, $i, 1) == "0") {
                $f2 = $fino;
            } else {
                $f2 = $largo;
            }
            ?>
                            src="../imagens/icones/codigo_barras/b.gif" width=<?php 
            echo $f2;
            ?>
 height=<?php 
            echo $altura;
            ?>
 border=0><img
                            <?php 
        }
    }
    // Draw guarda final
//.........这里部分代码省略.........
开发者ID:mauriciowitzgall,项目名称:SGAF,代码行数:101,代码来源:codigo_barras.php


示例6: f_personalizar

function f_personalizar($ident_empresa)
{
    global $s_empresa;
    global $s_reduzido;
    $esta_personalizado = 0;
    if (substr($ident_empresa, strlen($ident_empresa) - 1, 1) != "+") {
        $ident_empresa = $ident_empresa . "+";
    }
    while (strpos("?" . $ident_empresa, "+") > 0) {
        $qual_empresa = direita("+", $ident_empresa);
        if (strpos("?" . padrao_str($s_empresa, 1), padrao_str($qual_empresa, 1)) > 0 or strpos("?" . padrao_str($s_reduzido, 1), padrao_str($qual_empresa, 1)) > 0) {
            $esta_personalizado = 1;
        }
        $ident_empresa = esquerda("+", $ident_empresa);
    }
    return $esta_personalizado;
}
开发者ID:andrebonetti,项目名称:Gerensys,代码行数:17,代码来源:teste.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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