Results 1 to 3 of 3

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

  1. #1
    Join Date
    Jul 2012

    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:
    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
    I'd just keep them separate:
    PHP Code:
    echo $ConWidth "px";
    // or...
    echo "{$ConWidth}px";
    // or...
    But if you really want to merge them together in one variable, the clue is in the "." operator, above.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Jul 2012
    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