rtrim()
functionYou can use the PHP rtrim()
function to strip whitespace from the end of a string.
Let's check out an example to understand how this function basically works:
<?php
$my_str = 'Hello World! ';
echo strlen($my_str); // Outputs: 16
$trimmed_str = rtrim($my_str);
echo strlen($trimmed_str); // Outputs: 12
?>
i hope this small article will help you.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to Get List of File In Folder In PHP
In this article, I will share with you h...Create and Setup Symfony Project
Symfony is fast and leading PHP framewor...How to Count Number of Rows in a Table Using jQuery
Use the length Property You can simpl...Allow only Numbers to be Type in a Textbox
While building complex form, you might w...How to Setup 404 Page in Angular 12
In this article, we will create 404 erro...