PHP Equivalent function call for Perl Translation?

Discussion in 'PHP' started by clipster, Apr 5, 2008.

  1. #1
    Perl Function -
    $x='ABCD234cl59';
    $x=~tr/0-9//cd;
    print $x;
    yields 23459

    $y='ABCD234cl59';
    $y=~tr/A-Za-z//cd;
    print $y;
    yields ABCDcl

    Is there a simple one liner for php that is equivalent to the above example in perl?
    I've been trying to find something for a while and unable...
    Thanks in Advance.
     
    clipster, Apr 5, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    jayshah, Apr 5, 2008 IP