當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Stringy::substr方法代碼示例

本文整理匯總了PHP中Stringy\Stringy::substr方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stringy::substr方法的具體用法?PHP Stringy::substr怎麽用?PHP Stringy::substr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Stringy\Stringy的用法示例。


在下文中一共展示了Stringy::substr方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildDetail

 public function buildDetail(Stringy $linha)
 {
     $detail = new Detail();
     $cedente = new Cedente();
     $banco = new Banco();
     $banco->setCod($linha->substr(1, 3));
     $detail->setLote($linha->substr(4, 4))->setRegistro($linha->substr(8, 1))->setNumRegistroLote($linha->substr(9, 5))->setSegmento($linha->substr(14, 1))->setTipoMovimento($linha->substr(15, 1))->setCodMovimento($linha->substr(16, 2))->setCodBarras($linha->substr(18, 44))->setDataVencimento($this->createDate($linha->substr(92, 8)))->setValorTitulo($linha->substr(100, 13))->setDesconto($linha->substr(115, 13))->setAcrescimos($linha->substr(130, 13))->setDataPagamento($this->createDate($linha->substr(145, 8)))->setValorPagamento($linha->substr(153, 13))->setQuantidadeMoeda($linha->substr(168, 10))->setReferenciaSacado($linha->substr(183, 20))->setNossoNumero($linha->substr(203, 20))->setCodMoeda($linha->substr(223, 2))->addCnab($linha->substr(225, 6))->addOcorrencia($linha->substr(231, 10));
     $cedente->setNome($linha->substr(62, 30))->setBanco($banco);
     $detail->setCedente($cedente);
     return $detail;
 }
開發者ID:pagmovel,項目名稱:ya-retorno-boleto,代碼行數:11,代碼來源:SegmentoJ.php

示例2: buildDetail

 public function buildDetail(Stringy $linha)
 {
     $detail = new Detail();
     $banco = new Banco();
     $banco->setCod($linha->substr(1, 3));
     $detail->setLote($linha->substr(4, 4))->setRegistro($linha->substr(8, 1))->setNumRegistroLote($linha->substr(9, 5))->setSegmento($linha->substr(14, 1))->setTipoMovimento($linha->substr(15, 1))->setCodMovimento($linha->substr(16, 2));
     $banco->setAgencia($linha->substr(18, 5))->setDvAgencia($linha->substr(23, 1))->setConta($linha->substr(24, 12))->setDvConta($linha->substr(36, 1));
     $detail->setNossoNumero($linha->substr(38, 20))->setCarteira($linha->substr(58, 1))->setNumeroDocumento($linha->substr(59, 15))->setDataVencimento($linha->substr(74, 8))->setValorTitulo($linha->substr(82, 13));
     $banco->setCod($linha->substr(97, 3))->setAgencia($linha->substr(100, 5))->setDvAgencia($linha->substr(105, 1));
     $empresa = new Empresa();
     $empresa->addUso($linha->substr(106, 25));
     $detail->setCodMoeda($linha->substr(131, 2));
     $sacado = new Sacado();
     $sacado->setInscricao(new Inscricao($linha->substr(134, 15), $linha->substr(133, 1)))->setNome($linha->substr(149, 40));
     $detail->setNumeroContrato($linha->substr(189, 10))->setValorTarifa($linha->substr(199, 13))->addOcorrencia($linha->substr(214, 10))->addCnab($linha->substr(224, 17));
     $cedente = new Cedente();
     $cedente->setBanco($banco);
     $detail->setCedente($cedente)->setSacado($sacado);
     return $detail;
 }
開發者ID:pagmovel,項目名稱:ya-retorno-boleto,代碼行數:20,代碼來源:SegmentoT.php

示例3: buildDetail

 public function buildDetail(Stringy $linha)
 {
     $detail = new Detail();
     $banco = new Banco();
     $bancoSacado = new Banco();
     $sacado = new Sacado();
     $ocorrencia = new Ocorrencia();
     $dadosTitulo = new DadosTitulo();
     $cedente = new Cedente();
     $bancoSacado->setCod($linha->substr(1, 3));
     $sacado->setBanco($bancoSacado);
     $detail->setLote($linha->substr(4, 4))->setRegistro($linha->substr(8, 1))->setNumRegistroLote($linha->substr(9, 5))->setSegmento($linha->substr(14, 1))->addCnab($linha->substr(15, 1))->setCodMovimento($linha->substr(16, 2));
     //Dados do Titulo
     $dadosTitulo->setAcrescimos($this->convertToFloat($linha->substr(18, 15)))->setValorDesconto($this->convertToFloat($linha->substr(33, 15)))->setValorAbatimento($this->convertToFloat($linha->substr(48, 15)))->setValorIOF($this->convertToFloat($linha->substr(63, 15)))->setValorPago($this->convertToFloat($linha->substr(78, 15)))->setValorLiquido($this->convertToFloat($linha->substr(93, 15)));
     $detail->setDadosTitulo($dadosTitulo)->setOutrasDespesas($this->convertToFloat($linha->substr(108, 15)))->setOutrosCreditos($this->convertToFloat($linha->substr(123, 15)))->setDataOcorrencia($this->createDate($linha->substr(138, 8), "dmY"))->setDataCredito($this->createDate($linha->substr(146, 8), "dmY"));
     $ocorrencia->setCod($this->convertToInt($linha->substr(154, 4)))->setData($this->createDate($linha->substr(158, 8)))->setValor($this->convertToFloat($linha->substr(166, 15)))->setComplemento($linha->substr(181, 30));
     $banco->setCod($linha->substr(211, 3));
     $cedente->setBanco($banco);
     $detail->setNossoNumero($linha->substr(214, 20))->addCnab($linha->substr(234, 7));
     $detail->setCedente($cedente)->setSacado($sacado);
     return $detail;
 }
開發者ID:viniciusferreira,項目名稱:ya-retorno-boleto,代碼行數:22,代碼來源:SegmentoU.php


注:本文中的Stringy\Stringy::substr方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。