Q:

Write a PHP script to remove trailing slash from a string

0

Write a PHP script to remove trailing slash from a string.

Original String : 'The quick brown fox jumps over the lazy dog///'

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$my_str = 'The quick brown fox jumps over the lazy dog///';
echo rtrim($my_str, '/')."\n";
?>

Sample Output:

The quick brown fox jumps over the lazy dog

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now