Jump to content

PHP echo <div>


rubahfgouveia

Recommended Posts

I looks like it is because you are NOT concatenating $test[0] to the string, and your semi colon is inside the echo.

 

echo '<div class="event3" style="width:' . $test[0] . ' ">';

 

personally, when working with HTML I use HEREDOC

 

echo <<<OPT
<div class="event3" style="width:{$test[0]}">
OPT;
// The above line (OPT;) MUSTS be all the way to the left with no trailing data
// the first line must also have no trailing data

Link to comment
https://forums.phpfreaks.com/topic/256617-php-echo/#findComment-1315528
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.