Como lidar com strings complicadas no PHP
Publicado por Cézar Augusto em 15/04/2020
[ Hits: 1.662 ]
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)";
Partições BTRFS Nativamente no Windows
Problemas para instalar WoeUSB no Debian, Ubuntu e derivados [Resolvido]
Como ver a saída de qualquer comando MySQL no PHP
Ubuntu + Apache2 + MySQL + PHP5
Instalar Apache, PHP, MySQL e PostgreSQL no Ubuntu Linux 8.10
Instalação e configuração Apache2 + PHP + MySQL + PostgreSQL
Enviando parâmetros para o Google e gravando o resultado em banco
Novos apps de produtividade, avanços em IA e distros em ebulição agitam o universo Linux
Desktop Linux ganha novos apps enquanto IA invade o noticiário
Blender 5.0 Beta, Firefox 144 e avanço da IA dominam o dia no mundo Linux
Desktop Linux ganha fôlego enquanto distros refinam experiência e segurança
Wayland em alta, IA em debate e novos ventos para distros e devices
Como mudar o nome de dispositivos Bluetooth via linha de comando
Adicionando o repositório backports no Debian 13 Trixie
Erro ao fazer remaster usando Penguin eggs (4)
Linux x Plataformas de Trading - um problema (in-)solúvel? (3)