Function : striplastSlash

This function removes the last trailing slash of a string.

Syntax
  striplastSlash($string)
   
  $string  : supplied string url
   
                  
Sample 1
  $stripped = striplastSlash('site.com/user/profile/');
  
  vdump( $stripped ); // site.com/user/profile
                  
Sample 2
  $stripped = striplastSlash('site.com/user/profile/////');

  vdump( $stripped ); // site.com/user/profile
                  
Sample 3
  $stripped = striplastSlash('space\user\profile\\');

  vdump( $stripped ); // space\user\profile