Gli operatori sulle Stringhe in PHP

Gli operatori sulle Stringhe in PHP

Gli operatori sulle stringhe servono per manipolare e concatenare stringhe.

Contatenazione versione lunga

<?php
$stringa = 'Lorem ';
//versione lunga
$stringa = $stringa . 'Ipsus'; 

echo $stringa; // output : Lorem Ipsus
?>

Concatenazione versione corta

<?php
$stringa = 'Lorem ';
//versione corta
$stringa .= 'Ipsus'; // output : Lorem Ipsus

echo $stringa;
?>

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Copyright © 2023
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram