Is there a php library for converting data structures?
Colleagues, prompt the library to convert data structures (arrays, objects).
For example, there is an array (or object with this structure)
I need to:
$user['type']='student'; // a Constant, the same for all transformations of this type
I could write:
$user = array('type'=>'student','realname'=>$student['name'] ....);
But I don't want to.
I want to specify transformation rules in a separate object/configuration file to the conversion performed by the library. Among other things, this will help not hardcoding the data model rigidly, and ask it separately.
That is, we need some simple (and lightweight) analogue XSLT to transform data structures in PHP.
Came across something like that?