diff --git a/app/CustomFuncPao.php b/app/CustomFuncPao.php index c82773b5..f272c521 100644 --- a/app/CustomFuncPao.php +++ b/app/CustomFuncPao.php @@ -10,6 +10,11 @@ function showarray($array) echo '
' . json_encode($array, JSON_PRETTY_PRINT) . '
'; }; +function getarraystr($array) +{ + return '
' . json_encode($array, JSON_PRETTY_PRINT) . '
'; +}; + function isKeyPresent($array, $key) { foreach ($array as $item) { @@ -216,13 +221,13 @@ function loadArticleByIdArticle($id, $checkprevendita = false) } $ris = 'Articles:' . PHP_EOL; - $ris .= '
' . print_r($articles, true) . '
'; // Utilizzo di print_r con
 per formattare
+        $ris .= getarraystr($articles); // Converte solo i dati specificati in JSON
         
         $product = Product::where('sku', $id)->first();
         
-        $ris .= 'Product:' . PHP_EOL;
-        $ris .= '
' . print_r($product, true) . '
'; // Utilizzo di print_r con
 per formattare
-                
+        $ris .= 'Product:'. PHP_EOL;
+        $ris .= getarraystr($product);
+                        
         return $ris;
 
     } catch (\Exception $e) {