PHP Get Character at Index from String Example

Hi Dev,

In this example, I will show you php get character at index from string example. This tutorial will give you simple example of how to get Character at Index from string in php?. you will learn get character at index from string in php example. it's simple example of how to use function to get character at index from string in php? .

In this example to get character at index from string in PHP. in this example, this example in find to character at index from string. so Let's see the following example with output.

Example: Get Character at Index from String

index.php

<?php

$str = 'Hello World';

// Get Character at Index

$result = $str[0];

echo $result;

?>

Output:

H

I hope it could help you...