DealWithPostData.php 308 B

123456789101112131415161718
  1. <?php
  2. namespace common\util;
  3. class DealWithPostData
  4. {
  5. public static function changePostDataArrayToJson($post)
  6. {
  7. foreach ($post as $key => $value) {
  8. if (is_array($value)) {
  9. $post[$key] = json_encode($value);
  10. }
  11. }
  12. return $post;
  13. }
  14. }