SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Los Angeles, California
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    concatenation problem (I think)

    ok, here is the line of code that is giving me a problem (The one that start with "$tag...")
    PHP Code:
    function create ()
        {
        
    $tag "<font style=\"font-family: '" font_name() . "'; font-size: " font_size() . "pt; " font_bold() . font_italic() . "\">";
        echo 
    $tag;
        } 
    then later I have:
    <? create(); ?>hi!</font>
    then and it prints:
    sans-serif21<font style="font-family: ''; font-size: pt; ">hi!</font>
    whats wrong!? Those are my own functions and they all echo something (for example, font_size() echo's a number)
    www.iyeinteractive.com - Website Design and Programming
    www.totalnonsense.net - my site, Under Construction

  2. #2
    SitePoint Enthusiast Fubonis's Avatar
    Join Date
    Nov 2001
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the font_size(), etc. use

    PHP Code:
    function font_size()
    {
         
    // Just an example
         
    return 8;

    return would work, I believe.

  3. #3
    SitePoint Member burchyk's Avatar
    Join Date
    Mar 2002
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb Re: concatenation problem (I think)

    Hey, men, watch your quotes carefully!

    I was looking at your code & I can't figure out
    the arrangement of quotes

    Try this style:

    ' any tags with <xxx> and ...="xxx" '.$variable.' tags again'

    Maybe it's not the key here, but in my case the single
    quotes are always doing their job

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Los Angeles, California
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks to both of you

    return is exactly what I need

    and I did change all the quotes to single, much easier

    thanks again
    www.iyeinteractive.com - Website Design and Programming
    www.totalnonsense.net - my site, Under Construction


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
  •