Search code examples
phpcurly-braces

Confused about this php code using curly braces


while ( is_numeric( $flyer{$idPos} )) {
    //some code
}

What does $flyer{$idPos} mean assuming both are variables?


Solution

  • This is an alternative, not recommendable syntax for accessing array entries:

    $flyer{$idPos} === $flyer[$idPos]