php echo a variable code example
Example 1: linux shell echo command with varia ble
echo “A is $var1 and B is $var2”
Example 2: php echo variable
<?php
$name = "John Doe";
echo "Hey $name!";
?>
Example 3: echo variable bash
echo "${var}"
Example 4: bash echo in variable
#Just use following structure to store output of command into a variable:
var=$(command)
#For example:
var=$(echo 'hi') #store hi into var
var=$(ls) #store list of files into var
Example 5: php variable in echo
echo 'Hello '.$variableName.'!';