User Profile

Collapse

Profile Sidebar

Collapse
samdorrell4
samdorrell4
Last Activity: Jan 17 '12, 04:23 PM
Joined: Jan 17 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Ah, I think I made a mistake earlier, apparently I can just do this.

    Code:
    <?php
    $themeId = 1;  
    switch ($themeId){
        case (1):
            $bannerName = 'flowers.jpg';
            break;
        case (2):
            $bannerName = 'robots.jpg';
            break;
    }
    
    //my functions
    ...
    ...
    ?>
    Is this a decent way to do things in PHP?
    See more | Go to post
    Last edited by samdorrell4; Jan 17 '12, 04:23 PM. Reason: mistake with [code] tags

    Leave a comment:


  • Is there an elegant alternative in PHP for '#ifdef'

    I'd like to use Macros to control what functions/variables are used in order to test my PHP file. But I know PHP doesn't do Macros, so what would someone suggsest is an elegant way to do this? The reason for having the macros is so I can easily switch between one themeID and another while still having full control over each theme! Please ignore the fact that I've used some C constructs and others PHP!

    For instance:
    Code:
    #define
    ...
    See more | Go to post
No activity results to display
Show More
Working...