"if" with blocks of text

From: Lee David (affordable_turnkey_solutions_at_comcast.net)
Date: 03/26/05

  • Next message: Lüpher Cypher: "session variable"
    Date: Fri, 25 Mar 2005 20:11:03 -0600
    
    

    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
    <?php
      }
      if ($dow == 1)
     {
    ?>
      Monday text goes here

    I don't want to put it into variables and use echo as it is quite large. I
    pre-load a weeks worth of stuff and display different stuff each day.

    BTW, I did go to the www.php.com web site and looked for it under "if" and
    "alternative syntax".

    TIA,
    Jer


  • Next message: Lüpher Cypher: "session variable"

    Relevant Pages

    • Re: Object Oriented Content System - the idea
      ... >I expected php to be smarter then that. ... >form like bytecode in memory for the next request. ... each action added some stuff to a "response" XML document. ... that map/object/data and formats it for HTML display using an includeed PHP ...
      (comp.lang.php)
    • Re: session trouble
      ... Note that you're building your display block AFTER your loop. ... <?php session_start; ... The problem here is going to be since you have multiple school clubs, it's going to be hard to relate a particular club to the entry in your database if it going to be changed. ... Another way is to add a suffix to each field, often times the primary key for the table. ...
      (comp.lang.php)
    • Re: calling a javascript alert from php
      ... Php cannot popup an alert like JavaScript. ... You can do that with Php, but clicking on must create a request to the server to display a new page with as a form or hyperlinks. ...
      (comp.lang.php)
    • Re: Redirecting between PHP Pages
      ... but at the very least in a php script. ... > on the outcome of the validation, you want to do one of two things: ... with the various bits of HTML being ... Display login form ...
      (comp.lang.php)
    • Re: Open and process remote page
      ... William Hudson wrote: ... I have toyed with some of the php functions for opening URLs, ... > I need to fully emulate a browser, ... > display the remote page). ...
      (comp.lang.php)