Search
 
SCRIPT & CODE EXAMPLE
 

PHP

PHP rtrim — Strip whitespace (or other characters) from the end of a string

<?php

$text = "		These are a few words :) ...  ";
$binary = "x09Example stringx0A";
$hello  = "Hello World";
var_dump($text, $binary, $hello);

print "
";

$trimmed = rtrim($text);
var_dump($trimmed);

$trimmed = rtrim($text, " 	.");
var_dump($trimmed);

$trimmed = rtrim($hello, "Hdle");
var_dump($trimmed);

// trim the ASCII control characters at the end of $binary
// (from 0 to 31 inclusive)
$clean = rtrim($binary, "x00..x1F");
var_dump($clean);

?>
Comment

PREVIOUS NEXT
Code Example
Php :: php json_encode indent 
Php :: laravel filesystem link 
Php :: laravel eloquent duplicate record 
Php :: mp3 file upload code in php 
Php :: what is array_map in php 
Php :: laravel tinker insert db record 
Php :: count column eloquent laravel 
Php :: routes not defined 
Php :: get data from csv file in php and print in table 
Php :: file upload using ajax in laravel 
Php :: laravel copy image with new name 
Php :: php flatten array 
Php :: Method IlluminateDatabaseEloquentCollection::delete does not exist. 
Php :: how to run a php file in xampp 
Php :: php switch case greater than 
Php :: php preg replace 
Php :: how to setup cron job for laravel queues on shared hosting 
Php :: Diferencia entre dias PHP - Con date_diff() 
Php :: php array push 
Php :: woocommerce disable links on specific product 
Php :: preg_split 
Php :: how to run php in js 
Php :: woocommerce my account php code wordpress 
Php :: PHP - AJAX and PHP 
Php :: disadvantages of php 
Php :: laravel custom abort message 
Php :: laravel one to many relationship example 
Php :: laravel seeder with relationships 
Php :: laravel migration text length 
Php :: append single qoute arounf variable in php string 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =