Como lidar com strings complicadas no PHP
Publicado por Cézar Augusto em 15/04/2020
[ Hits: 1.433 ]
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)";
Cuidado com nomes de arquivos no Linux
Problemas para instalar WoeUSB no Debian, Ubuntu e derivados [Resolvido]
Como montar arquivos .img do Android
Partições BTRFS Nativamente no Windows
Ubuntu + Apache2 + MySQL + PHP5
Instalar Apache, PHP, MySQL e PostgreSQL no Ubuntu Linux 8.10
Mensagem de erro: "PHP Fatal error: Call to undefined function pg_connect()" [Resolvido]
Programa IRPF - Guia de Instalação e Resolução de alguns Problemas
Criando uma Infraestrutura para uma micro Empresa
Criar entrada (menuentry) ISO no Grub
Como gerar qualquer emoji ou símbolo unicode a partir do seu teclado
O Que Fazer Após Instalar Fedora 42
Debian 12 -- Errata - Correções de segurança
Instalando o Pi-Hole versão v5.18.4 depois do lançamento da versão v6.0
O FIM da minha distro predileta: ARCOLINUX ...que pena (6)
Copiar Layout do Teclado para aplicar em outra Distribuição (1)