PHP Variable vs Array vs Object

前端 未结 7 1382
忘掉有多难
忘掉有多难 2020-12-31 18:03

This is probably considered a really silly question, but I\'m in the process of putting together a simple template system for a website and am trying to keep track of my var

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-31 18:27

    In my opinion the cleanest way to set it up is in array like this:

    $tpl = array (
      'title' => 'my title',
      'desc' => 'my text'
    );
    

    You can combine it with Zane's answer also.

    All the best!

提交回复
热议问题