Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts

    define a constant using echo

    why this code gives error ?

    PHP Code:
    define(CSS , echo '<link href="style.css" rel="stylesheet" type="text/css">',FALSE); 

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    because the second argument to the define must be a string and the echo method returns void

    try
    PHP Code:
    define(CSS '<link href="style.css" rel="stylesheet" type="text/css">',FALSE); 
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow


  •  

    Posting Permissions

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