Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to cut middle part of text php

<?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';
echo $string[0];                 // a
echo $string[3];                 // d
echo $string[strlen($string)-1]; // f

?>
  
//substr() function returns certain bits of a string 
substr(string,start,length)
Comment

PREVIOUS NEXT
Code Example
Php :: Unable to open sqlite DB file from js axios.get request 
Php :: implode remove empty php 
Php :: wordpress remove current post in sidebar php 
Php :: how to create php message 00 
Php :: xampp php 
Php :: Create An Array Of Data With many Rows 
Php :: laravel how to generate short link in laravel framework and relation with 3 model 
Php :: list custom post in wp 
Php :: laravel how to read app/config/app.php debug variable 
Php :: laravel read csv 
Php :: laravel join with count 
Php :: base64 to arraybuffer php 
Php :: Call to undefined method AppModelsespece::links() laravel 8 
Php :: laravel How can I escase string in whereRaw 
Php :: Yii2 GridView Filtering on Relational Column 
Php :: hide my echo from page php 
Php :: symfony dump request headers 
Php :: WP DELETE UNUSED TAGS 
Php :: larqavel migration 
Php :: delete file in s3 laravel 
Php :: wordpress ftp functions.php 
Php :: implode (PHP 4, PHP 5, PHP 7, PHP 8) implode — Join array elements with a string 
Php :: trait class has consttoctor 
Php :: how can i check that a json file already has something inside 
Php :: open two files at once in phpstrom 
Php :: php doctrine findby greater than 
Php :: dompdf setoptions breaks images 
Php :: write to error log opencart 
Php :: list bulan php 
Php :: php pdo bindvalue array 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =