`preg_match()` sounds a bit overkill here :smiley: 

```php
if ( substr( $varName, -2 ) === '[]' )
```