PHP is messing with HTML Design & Displaying results outside of the HTML

前端 未结 1 2008
离开以前
离开以前 2021-01-26 16:42

I\'m not to sure why this happening, I\'m not \"that great\" in HTML or anything and I mainly assume my issue is how I\'m displaying the results...(any tips / help / or suggesti

1条回答
  •  感情败类
    2021-01-26 17:12

    index.php expects the displayFood() method to return a string, which it concatenates to the HTML and then prints. But displayFood() is echoing its results instead of returning them as a string.

    So you have to either change displayFood() to return a string, or change index.php to print the beginning HTML, call displayFood(), and then print the ending HTML, e.g.

    echo '
    
    
    ...
    
    
    ';

0 讨论(0)
提交回复
热议问题