PHP Variable vs Array vs Object

前端 未结 7 1371
忘掉有多难
忘掉有多难 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:30

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

    Like Goran said, with the bonus that you could store these arrays in an ini file later and extract them as needed with parse_ini_file

    Could be important if you want to permit users to write to their own ini file.

提交回复
热议问题