Why am I getting an “Undefined variable” notice in PHP?

后端 未结 2 977
借酒劲吻你
借酒劲吻你 2021-01-22 19:24

So I have the following:




Name:
2条回答
  •  执念已碎
    2021-01-22 20:21

    $defaults is a local variable within the scope of the show_form function. You'll want to return it from the function and change your first line of code to this:

    $defaults = show_form();
    

提交回复
热议问题