<header class='panel-title'> <div class='text-center'> <strong>$result[0]->first_name $result[0]->last_name</strong> </div> </header> This html code is in echo, how can you correctly display the variable that is $ result?
<?php echo "<header class='panel-title'> <div class='text-center'> <strong>".$result[0]->first_name ." ". $result[0]->last_name."</strong> </div> </header>" ?> Parse error: syntax error, unexpected '$result' (T_VARIABLE), expecting '}' in D:\OSPanel\domains\localhost\index.php on line 93 - K-9 Parse error: syntax error, unexpected '$result' (T_VARIABLE), expecting '}' in D:\OSPanel\domains\localhost\index.php on line 93well, or even as a more readable option, so you don’t get confused in ." and similar structures:
<?php echo "<header class='panel-title'> <div class='text-center'> <strong>{$result[0]->first_name} {$result[0]->last_name}</strong> </div> </header>"; ?> <header class='panel-title'> <div class='text-center'> <strong><?php echo $result[0]->first_name ." ". $result[0]->last_name; ?></strong> </div> </header> syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in - K-9Source: https://ru.stackoverflow.com/questions/852637/
All Articles