Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
PHP $string{0} vs. $string[0];
The syntax ‘$string{0} ‘ has been deprecated beginning from PHP version 6. Hence, it is strongly suggested to use $string[0].
In short, accessing characters using the flower braces {} has been deprecated. Hence the square brackets should be used [] −
Example
$string = 'medium';
echo $string{0};
echo $string[0];
Output
This will produce the following output −
mm
Advertisements
