Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $string = "something here.";
- $output = 'something here';
- $output = rtrim($string, '.');
- $string = "something here..";
- echo preg_replace("/.$/","",$string);
- <?php
- $output = $string;
- $last_char_pos = strlen($output) - 1;
- if ($output[ $last_char_pos ] == '.') {
- $output[ $last_char_pos ] = null;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement