diff --git a/api/php/data_to_php_array.php b/api/php/data_to_php_array.php
new file mode 100644
index 0000000..ca26990
--- /dev/null
+++ b/api/php/data_to_php_array.php
@@ -0,0 +1,58 @@
+ \[\n\s+\],\n#', "=> [],\n", $dump); // Empties
+
+ if (gettype($data) == 'object') { // Deal with object states
+ $dump = str_replace('__set_state(array(', '__set_state([', $dump);
+ $dump = preg_replace('#\)\)$#', "])", $dump);
+ } else {
+ $dump = preg_replace('#\)$#', "]", $dump);
+ }
+
+ if ($return===true) {
+ return $dump;
+ } else {
+ echo $dump;
+ }
+}
+
+switch ($input['mode']) {
+ case 'json':
+ echo var_export_short(@json_decode($data, true));
+ break;
+ default:
+ echo var_export_short(explode(empty($data_delimiter) ? "\n" : $data_delimiter, $data));
+ break;
+}
\ No newline at end of file
diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue
index d624521..1ce399b 100644
--- a/src/components/Sidebar.vue
+++ b/src/components/Sidebar.vue
@@ -34,6 +34,7 @@ export default {
'str_sort_lines': 'Str sort lines',
'str_to_lower_upper': 'Str to lower/upper',
'str_remove_duplicate_lines': 'Str remove duplicate lines',
+ 'str_to_php_array': 'Str to PHP array',
'url_encode_decode': 'URL encode/decode',
},
'SQL': {
diff --git a/src/router/index.js b/src/router/index.js
index 31adb45..e664d05 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -35,6 +35,11 @@ const router = createRouter({
name: 'str_remove_duplicate_lines',
component: () => import('../views/StrRemoveDuplicateLines.vue'),
},
+ {
+ path: '/str_to_php_array',
+ name: 'str_to_php_array',
+ component: () => import('../views/StrToPHPArray.vue'),
+ },
{
path: '/fix_ru_en_keyboard',
name: 'fix_ru_en_keyboard',
diff --git a/src/views/StrToPHPArray.vue b/src/views/StrToPHPArray.vue
new file mode 100644
index 0000000..a86e205
--- /dev/null
+++ b/src/views/StrToPHPArray.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file