php - symfony2 syntax error -


i have following code:

public function postformaction(request $request) {      $cityid = $request->request->get('shopioususerbundle_user')['location']['city'];      ..... } 

for reason giving me syntax error, idea why? when remove array indexing like:

$cityid = $request->request->get('shopioususerbundle_user') 

works fine.

array dereferencing result of function call available in php 5.4 or later.

see http://php.net/manual/en/language.types.array.php#example-88

if using earlier php version, have following

$data = $request->request->get('shopioususerbundle_user'); $cityid = $data['location']['city']; 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -