Welcome Guest, Not a member yet? Register   Sign In
ID in an html tag inside a php script
#3

[eluser]porquero[/eluser]
php only get variable values from double quote strings.
So you can use heredoc or nowdoc(php5.3):

Heredoc:
Code:
foreach ($myquery_domain->result() as $row ){
    $domain = $row->domain;
    $domain_id = $row->domain_id;
    echo <<<EOT
<tr>
<td>
  <span class="flip_domain" id="{$domain_id}">+</span>{$domain}
</td>
</tr>
EOT;
}

heredoc is more strict but you can get more maintanable code.


Messages In This Thread
ID in an html tag inside a php script - by El Forum - 01-18-2012, 09:54 PM
ID in an html tag inside a php script - by El Forum - 01-18-2012, 10:56 PM
ID in an html tag inside a php script - by El Forum - 01-19-2012, 06:50 AM
ID in an html tag inside a php script - by El Forum - 01-19-2012, 09:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB