Answers for "php string get last index of"

PHP
13

get last character of string php

substr("testers", -1); // returns "s"
Posted by: Guest on March-05-2020
0

php index of last element in array

<?php

$source_array = [
  'key1' => 'value1',
  'key2' => 'value2',
  'key3' => 'value3'
];

echo "Last index: " . array_key_last($source_array);

?>
Posted by: Guest on April-09-2021

Code answers related to "php string get last index of"

Browse Popular Code Answers by Language