php question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aztecvision
    Confirmed User
    • Feb 2003
    • 979

    #1

    php question

    How do you trim a variable's value to allways display a certain amount of characters, no matter how long the original varialbe may be?

    Example:
    $var1 = "123456789";
    I need to only display the first 6 characters "123456"; basically hidding 789
  • woj
    <&(©¿©)&>
    • Jul 2002
    • 47880

    #2
    echo substr($var1,0,6);

    ??
    Last edited by woj; 07-08-2005, 02:42 PM.
    Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
    Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
    Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

    Comment

    • aztecvision
      Confirmed User
      • Feb 2003
      • 979

      #3
      Thanks! I owe you a beer!

      Comment

      • MickeyG
        Confirmed User
        • May 2004
        • 4134

        #4
        next time try google, seriously you can find anything you want to know regarding php on there. I must use it a million times a day

        Comment

        Working...