research_run.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?php
  2. //include BASE_ROOT_PATH . "/research/db.php";
  3. //include BASE_ROOT_PATH . "/research/function_test.php";
  4. //include BASE_ROOT_PATH . "/research/sms_test.php";
  5. //include BASE_ROOT_PATH . "/research/wxpay.php";
  6. define('BASE_CORE_PATH',BASE_ROOT_PATH.'/core');
  7. define('BASE_DATA_PATH',BASE_ROOT_PATH.'/data');
  8. define('BASE_MOBILE_PATH',BASE_ROOT_PATH.'/mobile');
  9. define('BASE_CRONTAB_PATH',BASE_ROOT_PATH.'/crontab');
  10. define('BASE_UPLOAD_PATH',BASE_DATA_PATH.'/upload');
  11. define('BASE_UTIL_PATH',BASE_ROOT_PATH.'/util');
  12. require_once (BASE_ROOT_PATH . '/helper/text_filter.php');
  13. require_once (BASE_ROOT_PATH . '/helper/category_helper.php');
  14. define('InShopNC',true);
  15. $str = <<< EOT
  16. <script type="text/javascript">
  17. function app(){
  18. var app=navigator.userAgent.toLowerCase(),//判断设备
  19. app_nav=navigator.appVersion.toLowerCase(),
  20. href='';
  21. if(app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
  22. href='https://www.pgyer.com/pfcB';
  23. }else if(app.indexOf('micromessenger')>-1&&app_nav.indexOf('android')>-1){
  24. href="javascript:void(0)";
  25. }
  26. else {
  27. href='http://a.lrlz.com/data/upgrade/lrlz_release_1.0.8.apk';
  28. }
  29. return href;
  30. }
  31. function href(){
  32. $('#href_link').attr('href',app());
  33. }
  34. href();
  35. </script>
  36. <div class="top">
  37. <p class="title">红包详情</p>
  38. <div class="logo"></div>
  39. </div>
  40. EOT;
  41. $str = text_filter::filter_html($str);
  42. category_helper::instance()->
  43. $x = time();
  44. $member_birthday = strftime ("%Y-%m-%d %H:%M:%S",time());
  45. function is_date($time)
  46. {
  47. $pattern = '/[\d]{4}-[\d]{1,2}-[\d]{1,2}/';
  48. return (preg_match($pattern, $time) == 1);
  49. }
  50. $x = '';
  51. $y = isset($x);
  52. if('safdasefasefasf'==0){
  53. echo "该字符串转换为数字 等于 0 <br/>";
  54. }//output:该字符串转换为数字 等于零。
  55. $a='0';
  56. if($a==''){
  57. echo "0 等于 '' <br/>";
  58. } //output:0 等于''
  59. if(trim($a)==''){
  60. echo "trim(0)等于'' <br/>";
  61. } //no output
  62. if($a===''){
  63. echo "0==='' <br/>";
  64. } //no output
  65. if(empty($a)){
  66. echo "'' is empty <br/>";
  67. } //output:'' is empty
  68. if(is_null($a)){
  69. echo "0 is null <br/>";
  70. } //no output
  71. if(is_numeric($a)){
  72. echo "0 is numeric <br/>";
  73. } //output:0 is numeric
  74. if(is_string($a)){
  75. echo "0 is string <br/>";
  76. } //no output
  77. if(strval($a)==''){
  78. echo "转换成字符串的0 is '' <br/>";
  79. } //no output
  80. //========= 判断 0 和 '' 以及 empty null false的关系 end =========//
  81. //========= 判断 '' 和 0 以及 empty null false的关系 start =========//
  82. $b = '';
  83. if($b==0){
  84. echo "'' 等于 0 <br/>";
  85. } //output:'' 等于 0
  86. if(!''){
  87. echo "'' 就是false <br/>";
  88. } //output:'' 就是false
  89. if(!0){
  90. echo "0 就是false <br/>";
  91. } //output:0 就是false
  92. //========= 判断 '' 和 0 以及 empty null false的关系 end =========//
  93. echo "在判断空('')的时候一定要小心,0 也相当于'' ,0 和 '' 都相当于空字符和false,判断为空最好用===";
  94. $x = '1978-02-05';
  95. $y = is_date($x);
  96. $x = time();
  97. $member_birthday = strftime ("%Y-%m-%d","{$x}");
  98. $time = strtotime($member_birthday);
  99. $str = NULL;
  100. $y = '';
  101. if(isset($str)) {
  102. $x = 0;
  103. }
  104. if(empty($str)) {
  105. $x = 1;
  106. }
  107. if($str == NULL) {
  108. $x = 2;
  109. }
  110. if(isset($y)) {
  111. $x = 0;
  112. }
  113. if(empty($y)) {
  114. $x = 1;
  115. }
  116. if($y == NULL) {
  117. $x = 2;
  118. }
  119. $file = "/mobile/index.php";
  120. $ops = explode("?",$file);
  121. $squery = $ops[1];
  122. $params = preg_split('/&|=/', $squery);
  123. for ($i = 0; $i < count($params); ++$i) {
  124. $key = $params[$i];
  125. $val = $params[++$i];
  126. $_GET[$key] = $val;
  127. $_POST[$key] = $val;
  128. }
  129. $ret = array('jsObj' => NULL,'jsArray' => array());
  130. unset($ret['xxx']);
  131. $ret = json_encode($ret);
  132. define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
  133. echo BASE_ROOT_PATH."\n";
  134. require_once (BASE_ROOT_PATH . '/fooder.php');
  135. echo $argv;
  136. function help_out()
  137. {
  138. echo "fetch_goods:start fetch goods.\r\n";
  139. echo "fillgcid:start fill all goods class id.\r\n";
  140. echo "checkgoods:check all goods class id.\r\n";
  141. }
  142. $time = -microtime();
  143. //$hash = 0;
  144. //for ($i=0; $i < rand(1000,4000); ++$i) {
  145. // $hash ^= md5(substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, rand(1,10)));
  146. //}
  147. $time += microtime();
  148. $y = sprintf('%f', $time);
  149. $y = strtotime('2016-12-12 01:01:01');
  150. $y = urldecode('%E4%B8%AD%E9%80%9A%E5%BF%AB%E9%80%92');
  151. $x=new date();
  152. define('StartTime', microtime(true));
  153. define('TIMESTAMP', time());
  154. if(count($argv) == 1) {
  155. return;
  156. }