www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] NOOB, I Need To Place A Unit After Some Math....

  1. #1
    Join Date
    Jul 2012
    Posts
    32

    resolved [RESOLVED] NOOB, I Need To Place A Unit After Some Math....

    Okay So I Am Okay With PHP Because When I Need A Code I Cannot Think Of/Haven't Heard Of I Can Use Google, Look At Some Peoples Code And Usally Make It Work With My Project. But I Cannot Figgure This Out Because When Ever I Try To Google It I Get Excel Info Not PHP, So Here Is My Code
    PHP Code:
    $ConWidth = ($Width $LinkWidth); 
    I Want To Set It To Something Like This
    PHP Code:
    $ConWidth = ($Width $LinkWidth) + 'px'
    so I Can be like
    PHP Code:
    echo"$ConWidth"
    And It will echo 500px or what ever the answer is with the px after it,
    Thank You So Much, Sorry Imma Noob

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,239
    I'd just keep them separate:
    PHP Code:
    echo $ConWidth "px";
    // or...
    echo "{$ConWidth}px";
    // or...
    printf("%dpx"$ConWidth); 
    But if you really want to merge them together in one variable, the clue is in the "." operator, above.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jul 2012
    Posts
    32
    Thank You, I Used The
    PHP Code:
    $ConWidth = ($Width $LinkWidth) . "px"
    I Have Used The "." operator b4 but when i tried to use it early i must have messed somthing up cuss it works now, again Thank You So Much!

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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



Recent Articles