PHP grabbing arrays to create lines of code

前端 未结 4 708
别跟我提以往
别跟我提以往 2021-01-17 07:21

I would like to create something simple. Since I\'m new to PHP, I\'m struggling to see what I\'m doing wrong,. I have two PHP files content in code snippets below, as well a

4条回答
  •  孤独总比滥情好
    2021-01-17 07:39

    your code

    foreach ($toppingItems as $item) {
        echo "";
    }
    

    contains an error:

    You cannot use unescaped double quotes within a double quoted PHP string.

    Try:

    
        
    
    

    As you can see I've used to set my control structure, yet I've place my HTML outside of the php open and closing tag. Also I've used

     
    

    as short for

    
    

    This is a matter of preference, I find it makes the code more readable.

提交回复
热议问题