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;
?>

Scritto da Donato Pirolo

Ciao, sono Donato, frontend developer con una smisurata passione per la SEO. Creo strumenti ad hoc per aiutare aziende e professionisti ad essere cercati sul web e trovare clienti.

Potrebbero interessarti

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