php - Different behavior based on double or single quote -
this question has answer here:
i have little question regarding use of double quote , single quote.
when use code below double quotes echo ""
:
$result_entries = mysqli_query($con,"select * bhost_entries author_u_id='$user_info[u_id]'"); while($entries = $result_entries->fetch_object()) { echo " <tr> <td> {$entries->title} </td> </tr> "; }
..output be
entry1 entry2 entry3 etc..
but when use same code single quote echo ''
i'll get:
{$entries->title} {$entries->title} {$entries->title} etc..
as output.
why behave differently?
appreciate thoughts.
this because main difference between single , double qoutes. single qoutes not parse variables while double qoutes parse variables.
Comments
Post a Comment