title: How to match half URL using switch case for dynamic page title in php?
body: <p>I want to match URL in switch case for dynamic pages. But i am not able to print variable value in switch case.</p>
  
  <p>here is my html title code in header:  </p>
  
  <pre><code>    &lt;title&gt;&lt;?php echo $pageTitle; ?&gt;&lt;/title&gt;
  </code></pre>
  
  <p>and this is php: </p>
  
  <pre><code>    $name=$_GET['id'];
      switch ($_SERVER['PHP_SELF']){
          case "/web/index.php":
              $pageTitle = 'Home';
          break;
          case "/web/new_doc.php":
              $pageTitle = 'Document';
          break;
          case "/web/new_provider.php":
              $pageTitle = 'Provider';
          break;
          case "/web/read.php?id=$name":
              $pageTitle = 'Reader';
          break;      
          default:
              $pageTitle ='Page';
  </code></pre>
  
  <p>i want to match URL like this:</p>
  
  <pre><code>  read.php?id=amazon prime
    book.php?id[]=A Wasted Hour&amp;id[]=20
  </code></pre>
  
  <p>is there any way that i can match half part of URL in switch case like
        read.php?id= instead of full URL.</p>