removing trailing 0's from a binary string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Lawson

    removing trailing 0's from a binary string

    I need to trim off trailing 0x00's from a binary string. Does anyone know how?

    David

  • ZeldorBlat

    #2
    Re: removing trailing 0's from a binary string



    $newString = rtrim($someBinS tring, "0");

    Comment

    • Ken Robinson

      #3
      Re: removing trailing 0's from a binary string


      ZeldorBlat wrote:[color=blue]
      > http://us4.php.net/manual/en/function.rtrim.php
      >
      > $newString = rtrim($someBinS tring, "0");[/color]

      No, the OP wants to trim trailing NULL characters. I guess you could us
      rtrim() to do that also, but I'm not sure.

      Ken

      Comment

      Working...