Search
 
SCRIPT & CODE EXAMPLE
 

PHP

find index of a character in a string php

<?php
echo strpos("I love php, I love php too!","php");
?> 
Comment

index the string php


<?php
// Get the first character of a string
$str = 'This is a test.';
$first = $str[0];

// Get the third character of a string
$third = $str[2];

// Get the last character of a string.
$str = 'This is still a test.';
$last = $str[strlen($str)-1];

// Modify the last character of a string
$str = 'Look at the sea';
$str[strlen($str)-1] = 'e';

?>

Comment

PREVIOUS NEXT
Code Example
Php :: orwhere in wherehas laravel 
Php :: woocommerce return to shop custom url 
Php :: php socket connect 
Php :: violation: 1071 Specified key was too long; max key length is 1000 bytes 
Php :: php slice array in half 
Php :: php while jump to next loop 
Php :: display error meaages in laravel blade 
Php :: php mail template 
Php :: php string to date 
Php :: php array destructuring 
Php :: faker instance in tinker 
Php :: php add to array 
Php :: laravel default encryption mode 
Php :: php xml to json 
Php :: laravel access storage attachment 
Php :: switch between php version ubuntu 
Php :: routes not defined 
Php :: enable extensions in php.ini 
Php :: PHP MySQL Insert Multiple Records 
Php :: laravel set date format 
Php :: Get All dates of a month with laravel carbon 
Php :: woocommerce_variation_option_name on frontend 
Php :: laravel middleware 
Php :: laravel eloquent get all where in 
Php :: laravel eloquent get one column value 
Php :: laravel app service provider register 
Php :: which programming languae does php resemble to? 
Php :: spatie activity log 
Php :: Automatic Subdomain with PHP 
Php :: Get data from array (from an API) in Laravel 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =