Como lidar com strings complicadas no PHP
Publicado por Cézar Augusto em 15/04/2020
[ Hits: 575 ]
Blog: https://cizordj.github.io
<?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)";
Alterar resolução de tela pelo Xorg
Como verificar senha no shell script
Problemas para instalar WoeUSB no Debian, Ubuntu e derivados [Resolvido]
Como verificar a integridade das stock ROMs da Samsung
Ubuntu + Apache2 + MySQL + PHP5
mysql_num_fields e mysql_field_name no PHP
Mensagem de erro: "PHP Fatal error: Call to undefined function pg_connect()" [Resolvido]
Instalar Apache, PHP, MySQL e PostgreSQL no Ubuntu Linux 8.10
Descobrir a senha do PHPMyAdmin
Instalação do Gentoo GNU/Linux em um SSD NVMe (UEFI/GPT)
Adicionar mensagens iniciais no terminal nas sessões de sudo
Desenhar com o mouse na tela do desktop
Gerencie suas contas financeiras pessoais com Terminal Finances
Usando "sscanf" para Dividir String com Delimitadores em C
Processo aleatório consumindo CPU por meio do usuário Postgres