Load variables in text, how do variables output?
1. For Python, use the Format function
Cases:
Date= "Sunday";
Print ("Today is {0}". Format (data)); Output today is Sunday
where {0}{1}{2} ..... Can have multiple, in different locations, corresponding to the format (value 1, value 2, value 3 ...) The corresponding elements in the specific please Baidu this function usage
2. For Php,echo, use double quotes "" Only to line, call the variable name directly. Single quotes ' Do not parse variables
Cases:
$date = "Sunday";
echo "Today is $date"; Output today is Sunday
Echo ' Today is $date '; Output today is $date
Also note the use of escape characters \ Match single double quotes
Example: Suppose there is a div block element with a size
$v 1= "Red";
echo "<div style=\" backgroud:# $v 1;\ ">";//Red block
echo "<div style=" backgroud:# $v 1; > ";/Error
and the single quote echo ' <div style= ' backgroud:# $v 1; > '//Output <div style= "backgroud:# $v 1;" >
In the case of single double quotes, internal single quotes, outside with double quotes echo "class= ' $v 1 '"