Quantcast
Channel: What does this PHP syntax mean? - Stack Overflow
Browsing all 5 articles
Browse latest View live

Answer by Artefacto for What does this PHP syntax mean?

EDIT This thread may interest you: "dropping curly braces"It's just an alternative syntax; the two forms compile to exactly the same bytecode:<?php$str = "aaab";echo $str{3}; echo $str[3]; number of...

View Article



Answer by silent for What does this PHP syntax mean?

You can read here in official documentation about braces:String s may also be accessed using braces, as in $str{42}, for the same purpose. However, this syntax is deprecated as of PHP 5.3.0. Use square...

View Article

Answer by Macmade for What does this PHP syntax mean?

It's the same, but the {} syntax is deprecated as of PHP 5.3.

View Article

Answer by Sergey Eremin for What does this PHP syntax mean?

{} and [] are the same. it is your choice what to use. [] is more common though.

View Article

What does this PHP syntax mean?

Consider the code:$a = "foobar";echo $a{3}; // prints bI know $a[3] is 'b' but how come using {} in place of [] produec the same result ?

View Article

Browsing all 5 articles
Browse latest View live




Latest Images