+ Reply to Thread
Results 1 to 9 of 9

Thread: Define PHP the Long Way

  1. #1
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Cool Define PHP the Long Way

    Hi everyone! Now everyone knows you define a PHP script like this:

    Code:
    <?php echo "Hello World"?>
    However, I recently learnt that there is another way to achieve this - like this:

    Code:
    <script language="php">echo "Hello World";</script> 
    It's not much of a tutorial, but I just thought it was interesting to show.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Jaan Guest

    Re: Define PHP the Long Way

    looking good..
    thanks dude

  4. #3
    Jordan Guest

    Re: Define PHP the Long Way

    Nice information to know! Thanks! +rep

  5. #4
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: Define PHP the Long Way

    It's sort of a long-winded way, but it's a tool nonetheless. I suppose it might just have its uses, somewhere or other.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  6. #5
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: Define PHP the Long Way

    I've found another way to define it - and this time it's simpler than normal!

    The usual way:
    Code:
    <?php echo "Hello World"?>
    The SHORT way:
    Code:
    <? echo "Hello World"?>
    So if you drop the "php" from your scripts, and you write 100 scripts, you'll save yourself from typing 300 extra keys... that's gotta be worth it, no?

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  7. #6
    nullbyte's Avatar
    nullbyte is offline Programming Professional
    Join Date
    Oct 2007
    Location
    ~
    Posts
    302
    Rep Power
    19

    Re: Define PHP the Long Way

    Well, for the short way to work you must enabled short_tags in your PHP configuration file

  8. #7
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: Define PHP the Long Way

    Yeah, but I have.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  9. #8
    Whitey's Avatar
    Whitey is offline Programming Professional
    Join Date
    Feb 2008
    Location
    Loveland, Colorado
    Posts
    254
    Rep Power
    18

    Re: Define PHP the Long Way

    Also if you want a quick way to echo something.. Like in a value
    ie:
    Code:
    <input value="<?='hey';?>">
    so
    Code:
    <?="hey";?>
    is the quick way xD

  10. #9
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: Define PHP the Long Way

    True, although your example isn't the most useful.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. learning to use #define
    By jackson6612 in forum C and C++
    Replies: 4
    Last Post: 09-21-2011, 12:36 PM
  2. C++ Define operators (for vector)
    By notes in forum C and C++
    Replies: 2
    Last Post: 08-25-2011, 06:55 PM
  3. Define Love Error!
    By Guest in forum The Lounge
    Replies: 12
    Last Post: 05-04-2010, 02:40 PM
  4. how to define how to print an object
    By denarced in forum Python
    Replies: 2
    Last Post: 03-15-2010, 10:24 PM
  5. Define installation folder
    By hampus.tagerud in forum Visual Basic Programming
    Replies: 0
    Last Post: 11-15-2008, 09:34 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts