Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php trim string to length

<?php
echo substr('abcdef', 1);     // bcdef
echo substr('abcdef', 1, 3);  // bcd
echo substr('abcdef', 0, 4);  // abcd
echo substr('abcdef', 0, 8);  // abcdef
echo substr('abcdef', -1, 1); // f

// Accessing single characters in a string
// can also be achieved using "square brackets"
$string = 'abcdef';
Comment

PREVIOUS NEXT
Code Example
Php :: laravel date default now 
Php :: PHP strtoupper() Function 
Php :: how to run php file in xampp 
Php :: update-alternatives java 
Php :: laravel faker title 
Php :: composer autoload psr-4 
Php :: SELECT query with PDO 
Php :: if browser url is having domain in it check using php 
Php :: php get and print file contents 
Php :: num_rows in php 
Php :: laravel run a specific migration 
Php :: table drop foreign php laravel 
Php :: laravel get url path 
Php :: laravel get db connection info 
Php :: laravel return json header json 
Php :: laravel storage get file path 
Php :: laravel created_at where date format 
Php :: get the url without the query string php 
Php :: valet laravel 
Php :: PHP strtotime() Function 
Php :: php create url with query sting from array 
Php :: max. post size 
Php :: laravel get subdomain 
Php :: laravel wherehas with condition 
Php :: Download multiple files as zip in PHP 
Php :: add pagination to wordpress 
Php :: laravel weekly data 
Php :: how set field after another field in migration in laravel 
Php :: laravel count by date 
Php :: laravel 404 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =