PHP Forum

Reduce redundancies in switch functions?

Hello all! I somewhat new to PHP, and was wondering if anyone could give some suggestions on a switch function to reduce redundancies, and to efficaciously implement the script on to other sites.
Code:
<?php

$choice=$_GET['act'];

switch($choice)
{
case 'about':
if(file_exists("includes/about.php"))
include("includes/about.php");
break;

case 'contact':
if(file_exists("includes/contact.php"))
include("includes/contact.php");
break;

default;
include("includes/about.php"); }

?>
Advertisement

0 answers

No answers posted yet. Be the first to answer.

Your answer

Login to answer

Trending today: see what people are reading