strrev

  • Reversing a string is done with Ruby’s String#reverse method.

    PHP

    $result = strrev('Chunky bacon!');
    var_export($result);
    // => '!nocab yknuhC'

    Ruby

    p "Chunky bacon!".reverse
    # => "!nocab yknuhC"
strpos strrpos

Looking for Rails or PHP web application development, integration, and training?

Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.