Como lidar com strings complicadas no PHP
Publicado por Cézar Augusto em 15/04/2020
[ Hits: 1.450 ]
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)";
Problemas para instalar WoeUSB no Debian, Ubuntu e derivados [Resolvido]
Como verificar senha no shell script
Alterar resolução de tela pelo monitors.xml
Tema escuro no Elementary sem programas
Mensagem de erro: "PHP Fatal error: Call to undefined function pg_connect()" [Resolvido]
mysql_num_fields e mysql_field_name no PHP
Instalar Apache, PHP, MySQL e PostgreSQL no Ubuntu Linux 8.10
Compilando o PHP4 com acesso ao banco Interbase / Firebird no Conectiva 9
Configurando o phpMyAdmin para acessar o MySQL remotamente
Resolver problemas de Internet
Como compartilhar a tela do Ubuntu com uma Smart TV (LG, Samsung, etc.)
Descritores de Arquivos e Swappiness
Solução rápida para o problema do Network Manager conectar mas não navegar
Como instalar no Linux Jogos da Steam só para Windows
Instalando o Team Viewer no Debian Trixie - problema no Policykit
Mouse bluetooth OEX Motion MS 406 (0)
Como instalar o KDE3 em Distros Atuais ou Quase (3)
preciso de ajuda aqui... [RESOLVIDO] (12)
Não acesso a conta do Banco do Brasil pelo Google Chrome [RESOLVIDO] (5)