The closest to php array format
that I know about is [man]var_export[/man]
But I wonder if not some (Simple)XML PHP Class would do the job ....
This I do know so much about 🙂
This var_export() example based on what you posted
will output what you see below
<?php
$availableCols = array(
'version'=>1.0,
'description'=>'This is the first array implementation of relatebase_views and _views_items',
'scheme'=>array(
/*list these in order they would normally appear; analogous to Tbird's list of all inbox cols available */
'RepCode'=>array(
'method'=>'field',
'fieldExpressionFunction'=>'RepCode',
'header'=>'Rep',
'orderBy'=>'RepCode $asc, LastName $asc, FirstName $asc',
'visibility'=>'COL_VISIBLE',
'colposition'=>1
),
'StatusHandle'=>array(
'method'=>'field', /* the default */
'fieldExpressionFunction'=>'StatusHandle', /* the default */
'format'=>'default', /* use field attributes themselves*/
'datatype'=>'text', /* could be email, phone number, URL, link, popup - conflicts possible */
'sortable'=>true, /* the default */
'sortTitle'=>'Sort by member status',
'header'=>'Status',
/* this called AFTER $sort and $asc present but before the query, for sort=Status */
'orderBy'=>'StatusHandle $asc, /* extra stuff is nice :) */ LastName $asc, FirstName $asc',
/* ------- etc., etc., etc. -------- */
'colorCoding'=>'NULL',
'visibility'=>'COL_VISIBLE',
'colposition'=>2
)
)
);
echo '<pre>';
var_export( $availableCols ); // var_export array
?>
array (
'version' => 1,
'description' => 'This is the first array implementation of relatebase_views and _views_items',
'scheme' =>
array (
'RepCode' =>
array (
'method' => 'field',
'fieldExpressionFunction' => 'RepCode',
'header' => 'Rep',
'orderBy' => 'RepCode $asc, LastName $asc, FirstName $asc',
'visibility' => 'COL_VISIBLE',
'colposition' => 1,
),
'StatusHandle' =>
array (
'method' => 'field',
'fieldExpressionFunction' => 'StatusHandle',
'format' => 'default',
'datatype' => 'text',
'sortable' => true,
'sortTitle' => 'Sort by member status',
'header' => 'Status',
'orderBy' => 'StatusHandle $asc, /* extra stuff is nice :) */ LastName $asc, FirstName $asc',
'colorCoding' => 'NULL',
'visibility' => 'COL_VISIBLE',
'colposition' => 2,
),
),
)