Como lidar com strings complicadas no PHP
Publicado por Cézar Augusto em 15/04/2020
[ Hits: 1.489 ]
Blog: https://www.cezarcampos.com.br/
<?php public function insert(Bill $bill, int $user_id) : bool { $link = $this->link; $billetBanking = $link->real_escape_string($bill->getBilletBanking()); $sql = "INSERT INTO `bill` (`description`, `price`, `expirationDate`, `barCode`, `billetBanking`, `paid`) ". "VALUES ('".$bill->getDescription()."', '".$bill->getPrice()."', '".$bill->getExpirationDate()."', '".$bill->getBarCode()."', ". "'".$billetBanking."', CONV('0', 2, 10) + 0)"; $link->query($sql); return $this->addRelation($user_id); } ?>
<?php
$msg = "
O
l
a
m
u
n
do";
echo $msg;
// Vai imprimir
// O l a m u n do
?>
$sql = "INSERT INTO `bill` (`description`, `price`, `expirationDate`, `barCode`, `billetBanking`, `paid`) VALUES ('{$bill->getDescription()}', '{$bill->getPrice()}', '{$bill->getExpirationDate()}', '{$bill->getBarCode()}', '{$billetBanking}', CONV('0', 2, 10) + 0)";
$sql = "INSERT INTO `bill` (`description`, `price`, `expirationDate`, `barCode`, `billetBanking`, `paid`) ". "VALUES ('".$bill->getDescription()."', '".$bill->getPrice()."', '".$bill->getExpirationDate()."', '".$bill->getBarCode()."', ". "'".$billetBanking."', CONV('0', 2, 10) + 0)";
Como montar arquivos .img do Android
Cuidado com nomes de arquivos no Linux
Como verificar senha no shell script
Servidor web simples sem instalar nada
Configurando o phpMyAdmin para acessar o MySQL remotamente
Mostrar os campos de uma tabela do PostgreSQL com PHP
Mensagem de erro: "PHP Fatal error: Call to undefined function pg_connect()" [Resolvido]
Instalação e configuração Apache2 + PHP + MySQL + PostgreSQL
Compilando o PHP4 com acesso ao banco Interbase / Firebird no Conectiva 9
Como gerar um podcast a partir de um livro em PDF
Automatizando digitação de códigos 2FA no browser
Resolver problemas de Internet
Como compartilhar a tela do Ubuntu com uma Smart TV (LG, Samsung, etc.)
Conheça a 4Devs, caixa de ferramentas online para desenvolvedores
Como converter um vídeo MP4 para um GIF para publicar no README.md do seu repositório Github
Como Instalar o Microsoft Teams no Linux Ubuntu