0

Hi
I am looking for a php code formatter that has to has two features:
formatting arrays, so an array like this:

array ('key_of_first_value' => 'value','another_key' => 'value1', 'test_key' => 'value2');

to this (note that the sign => is aligned among all array elements):

array (
'key_of_first_value'   => 'value',
'another_key'          => 'value1',
'test_key'             => 'value2'
);

the second feature is aligning variables and their values when they are consecutive, so this code:

$var = 'test';
$another_var = 'another test';
$variable = 'test also';
$test_variable = 'for test only';

will look like this:

$var            = 'test';
$another_var    = 'another test';
$variable       = 'test also';
$test_variable  = 'for test only';

I have been googling about this for hours but with no luck.

Edited by khr2003: n/a

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by khr2003
0

Google is your friend.
I would suggest using preg_match_all to retrieve the data then display the data in the proper formatting with loops.

0

I use Polystyle, but it doesn't offer what you ask. But you could ask their support. It may be a feature I haven't found yet (since I don't code like that).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.