Is switch/case okay to use with long scripts?
<p>I was wondering if the following is okay:</p>

<p>So I have a bunch of different types of records I want to add and the forms for each type is different.  For example, Apple.php, Banana.php, Chocolate.php.  I don't want to create a different processing php file for each one and would like to have all the processing instructions on one file, add.php, instead of having addApple.php, addBanana.php, etc.</p>

<p>Is it okay to find the url and use a switch/case to run the instructions based on the url? </p>

<p>for example:</p>

<pre><code>$uri = $_SERVER['HTTP_REFERER'];
switch (true) {
case (strstr($uri,'apple')):
  //20 lines of code to insert records
break;
case (strstr($uri,'banana')):
 //30 lines of code to insert records
break;
</code></pre>

<p>I am wondering because in a lot of the switch/case examples, it seems like it's often used to echo something.  </p>
