<?php getFilename($itemType, $conditions) { arsort($conditions); $fileName = ''; foreach ($conditions as $key => $value) { //TODO: should this be other in case of : and , ? $fileName .= ($fileName != '' ? ',' : '') . $key . ':' . $value; } $fileName = $itemType . '{' . $fileName . '}'; return $fileName; } var_dump(getFilename('test', [ 'test' => 'test', 'monkey' => 'aap' ]));
You have javascript disabled. You will not be able to edit any code.