test.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
  2. <script type="text/javascript" src="http://localhost:8055/chatroom/res/js/jquery.cookie.js"></script>
  3. <?php
  4. //include "autoload.php";
  5. //$config = Utils::config();
  6. //$pact = 'login';
  7. /*function isAction($pact,$config)
  8. {
  9. $data = isParame($config['server_pact'], $pact);
  10. if ($data) {
  11. var_dump($pact);
  12. }
  13. var_dump($data);
  14. }*/
  15. /***
  16. * 参数是否为空
  17. * @param $data
  18. * @return bool
  19. */
  20. /* function isParame($data, $key)
  21. {
  22. if ($red = isDatas($data, $key)) {
  23. return $red;
  24. }
  25. log_message::info("$key is null ");
  26. //exit(Utils::sendResults("$key is null"));
  27. //exit(Utils::errorCode("$key is null ", FAILURE));
  28. return null;
  29. }
  30. $data = isParame($config['server_pact'], $pact);
  31. if (in_array($pact, $config['server_pact'])) {
  32. echo "dddddddd". $pact;
  33. }
  34. isAction('login',$config);*/
  35. /*function tess()
  36. {
  37. return "123";
  38. }
  39. $dd = 'tess';
  40. if (function_exists($dd)) {
  41. echo $dd();
  42. } else {
  43. echo "fall";
  44. }*/
  45. $dd = '{"friend_msg":"555","friendid":2105055520,"friend_nickname":"byjames","create_at":"2019-05-12 星期日 20:01:58","status":1}';
  46. $aa = ' {"friend_msg":"dff123","friendid":2105055520,"friend_nickname":"byjames","create_at":"2019-05-12 星期日 20:01:58","status":1}';
  47. $cc2 = ' {"friend_msg":"dff1234","friendid":2105055520,"friend_nickname":"byjames","create_at":"2019-05-12 星期日 20:01:58","status":1}';
  48. $a = json_decode($dd, true);
  49. $b = json_decode($aa, true);
  50. //var_dump($a);
  51. echo "<br>";
  52. //var_dump($b);
  53. echo "<br>";
  54. $m = $a + $b;
  55. $data[] = $a;
  56. $data[] = $b;
  57. //var_dump($data);
  58. $aa = json_encode($data, JSON_UNESCAPED_UNICODE);
  59. $cc = json_decode($aa, true);
  60. $dam[] = $cc;
  61. $dam[] = json_decode($cc2, true);
  62. echo count($a);
  63. echo count($b, 1);
  64. ?>