本文整理汇总了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;
}
示例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;
}
示例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;
}