Sorry, I know this is the main question, but I tried for hours, and I cnt seemed to think that was not the case!
echo '<tr><td><img src="images/$row['picture']" alt="' . $row['username'] . '" /></td>';
- A cleaner way to do this without error.
thank
'
I would do it like this:
echo '<tr><td><img src="images/' . $row['picture'] . '" alt="' . $row['username'] . '" /></td>';
There are several other ways to do this, but I would not recommend using short tags or inserting variables into ever strings . It doesn't matter if it's double quotation marks, break the line and concatenate. It is much easier on the eyes and makes for cleaner code.
, , .
,
echo '<tr><td><img src="images/', $row['picture'], '" alt="', $row['username'], '" /></td>';
echo "<tr><td><img src='images/{$row['picture']}' alt='{$row['username']}' /></td>";
PHP.
?> <tr><td><img src="images/<?=$row['picture']?>" alt="<?=$row['username']?>" /></td> <?
' . $row[', . , echo $row['picture'] (. ), ("), .
$row['
$row['picture']
"
, : ( .) PHP. Echo , :
.
, <?=, <?php echo:
<?=
<?php echo
<?= $value, ' + 1 = ', $value + 1 ?>
$row ['picture']
, :
echo "<tr><td><img src='images/{$row['picture']}' alt='{$row['username']}'/></td>";
If you have double quotes, you can include array values ββin a string if they are enclosed in {}. Of course, you need to change the double quotes in the html elements to single ones or to avoid them.
Source: https://habr.com/ru/post/1763869/More articles:The first call to GetTokenInformation (). What for? - c ++Methods to reduce URL size? - urlHow to determine if client turned javascript on / off from Rails? - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1763867/passing-variadic-class-templates-sub-classes-to-function-that-only-accepts-the-base-class-via-parameter-pack-deductioninference&usg=ALkJrhgmfHV4uiahVRYX3wmSNXXOSQDq2wWhat is the meaning of <% @ and A few questions regarding the Android kernel - cWhat is the difference between explicit and implicit locking in a database? - database-lockingQT CSS Property Selectors - qtcross browser hides mouse cursor - javascriptASP.NET - FormView - Datasource updates only some of the fields - asp.netAll Articles