title: Change HTML text by URL using *.ini config file
body: <p>I am trying to find out a good way to change HTML text by the URL currently displayed. I've got a list of all addresses what could appear in the URL line and corresponding text stored in *.ini file.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>...
  &lt;?php $conf = parse_ini_file('config.ini.php'); ?&gt;
  &lt;script type="text/javascript"&gt;
   $(function() {
     var pgurl = window.location.href.substr(window.location.href.lastIndexOf("/")+1);
     var baseurl = window.location.href
     $("ul.navbar li a").each(function(){
       if($(this).attr("href") == pgurl || $(this).attr("href") == baseurl )
       $(this).parent('li').addClass("active");
     })
   });
  &lt;/script&gt;
  ...
  &lt;h4 class="panel-title"&gt;Home&lt;/h4&gt;
  ...
  &lt;ul class="navbar"&gt;
    &lt;li&gt;&lt;a href="&lt;?php echo $conf['webaddr']; ?&gt;"&gt;&lt;?php echo $conf['page_0']; ?&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="&lt;?php echo $conf['page_1_addr']; ?&gt;"&gt;&lt;?php echo $conf['page_1']; ?&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="&lt;?php echo $conf['page_2_addr']; ?&gt;"&gt;&lt;?php echo $conf['page_2']; ?&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="&lt;?php echo $conf['page_3_addr']; ?&gt;"&gt;&lt;?php echo $conf['page_3']; ?&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="&lt;?php echo $conf['page_4_addr']; ?&gt;"&gt;&lt;?php echo $conf['page_4']; ?&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="&lt;?php echo $conf['page_5_addr']; ?&gt;"&gt;&lt;?php echo $conf['page_5']; ?&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="&lt;?php echo $conf['page_6_addr']; ?&gt;"&gt;&lt;?php echo $conf['page_6']; ?&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  ...
  </code></pre>
  
  <p><strong>*.INI</strong></p>
  
  <pre><code>...
  [site_url]
  webaddr='http://example.com/';  -- be sure to include forward slash after the web address!
  
  [pages]
  page_0='Home';
  page_1='Page 1';
  page_2='Page 2';
  page_3='Page 3';
  page_4='Page 4';
  page_5='Page 6';
  page_6='Page 7';
  
  [pages_addr]
  page_0_addr='#';
  page_1_addr='page1.php';
  page_2_addr='page2.php';
  page_3_addr='page3.php';
  page_4_addr='page4.php';
  page_5_addr='page5.php';
  page_6_addr='page6.php';
  ...
  </code></pre>
  
  <p>The text to change in this case would be <strong>Home</strong> in <strong>H4 element</strong></p>
  
  <p>I though the best solution will be using JavaScript, but I don't know how to correctly parse the *.ini file into JavaSrcipt and how to compare then.</p>