Re: must be a better way

From: Date: Tue, 17 Oct 2000 23:15:44 +0000
Subject: Re: must be a better way
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20732@lists.php.net to get a copy of this message
$PAGE_TITLE[/about.html] = "About the Company"; $PAGE_TITLE[/services.html] = "Available Services"; $PAGE_TITLE[/products.html] = "Available Products"; $PAGE_TITLE[/index.html] = "Welcome"; $PAGE_TITLE[/] = "Welcome"; $header = $PAGE_TITLE[$PHP_SELF]; That is about the cleanest way I can think of... > I know there is a better way to express what I have here > I just can't think of it today... > > if (ereg ("services", $PHP_SELF)) > { > $header = "Available Services"; > } > else > { > $header = "Welcome"; > } > > if (ereg ("about", $PHP_SELF)) > { > $header = "About the Company"; > } > else > { > $header = "Welcome"; > } > > would it be like this, maybe? > if (ereg ("something", $string)) > { > $something = "this"; > } > else > { > $something = "that"; > } > elseif (ereg ("somethingelse", $string)) > { > $something = "this"; > } > > additionally is there a way to declare 2+ variables > for one true outcome i.e. > if (true) { > $item = "something"&& > $item2 = "somethingelse"; } > > > Jerry Lake - jerryl@europa.com > Web Designer > Europa Communications - http://www.europa.com > Pacifier Online - http://www.pacifier.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#20732) next »