Website Development Prices

Search Blog

Friday, May 8, 2015

Interpolacija promenljivih (Interpolation of variables)

Interpolacija promenljivih 1 - koristiti promenljive izmedju duplih navodnika.

<?php

$ime = "Suzuki";
echo "Ja volim $ime"; // rezultat: Ja volim Suzuki
?>

Interpolacija promenljivih 2 - promenljive postavite u viticastu zagradu, da zamenite njenu vrednost unutar reci koja nije odvojena sa bilo kojim razmacima.

<?php
$jedan = "motor";

echo "Gde je {$jedan}bike.";
?>

Interpolation of variables 1 - use variables between the double quotes.

<? php

$name = "Suzuki";
echo "I like $name"; // Result: I like Suzuki
?>

Interpolation 2 variables - variables set in braces, to replace its value within the word that is not separated by any character.

<? php
$one = "motobike";

echo "Where's ${one}bike."
?>

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.