Re: "if" with blocks of text
From: Beauregard T. Shagnasty (a.nony.mous_at_example.invalid)
Date: 03/26/05
- Next message: Lüpher Cypher: "Re: session variable"
- Previous message: Oli Filth: "Re: session variable"
- In reply to: Lee David: ""if" with blocks of text"
- Next in thread: jorj: "Re: "if" with blocks of text"
- Reply: jorj: "Re: "if" with blocks of text"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 26 Mar 2005 00:33:04 -0500
Lee David wrote:
> I would like to have PHP decide which block of text to display on the web
> page. I'm doing this in javascript now, but think PHP could do it a little
> cleaner. I saw once (and can't find again) something like this:
>
> <?php
> $date = getdate();
> $dow = $date["wday"];
>
> if ($dow == 0)
> {
> ?>
> Sunday text goes here
...
Look up "switch". Much cleaner code.
http://us3.php.net/manual/en/control-structures.switch.php
--
-bts
-This space intentionally left blank.
- Next message: Lüpher Cypher: "Re: session variable"
- Previous message: Oli Filth: "Re: session variable"
- In reply to: Lee David: ""if" with blocks of text"
- Next in thread: jorj: "Re: "if" with blocks of text"
- Reply: jorj: "Re: "if" with blocks of text"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|