小编Cod*_*uru的帖子

合并日期和时间

$combinedDT = date('Y-m-d H:i:s', strtotime('$date $time'));
Run Code Online (Sandbox Code Playgroud)

日期格式2013-10-14

时间格式23:40:19

我试图存储到datetime数据类型时得到零

html php time datetime date

18
推荐指数
2
解决办法
3万
查看次数

json_encode给出递归错误

Warning:  json_encode(): recursion detected in [Directory] 
Run Code Online (Sandbox Code Playgroud)

这是什么错误,我似乎无法解决这个问题.每面对500个错误,它会生成一个BIG BIG日志.133,000,000字节大小.这是垃圾邮件,直到内存最大化.

<?php
include('simple_html_dom.php');

if(isset($_REQUEST['type']) && $_REQUEST['type'] = "getmoredetails"){ 
retrievemore($_REQUEST['htmlsource']);
}

function retrievemore($htmlcode){
$retrievetitle = retrievechTitle($htmlcode);
$retrievermb = retrievechRMB($htmlcode);
echo json_encode(array("error"=>0,"rmb"=>$retrievermb,"title"=>$retrievetitle));
}
function retrievechTitle($htmlcode){
$html = str_get_html($htmlcode);
$title = $html->find('div[class=tb-detail-hd]h3');
return $title[0];
}
function retrievechRMB($htmlcode){
$html = str_get_html($htmlcode);
$rmb = $html->find('[class=tb-rmb-num]');
return $rmb[0];
}

?>
Run Code Online (Sandbox Code Playgroud)

我正在尝试从HTML文件中提取数据,其他提取工作正常,除了上述情况,给出了很多问题.我甚至将这组代码专门分配给一个PHP文件进行处理和同样的问题.

任何的想法?我在主页上使用带有多个函数的jQuery Ajax,$.ajax({
我是Ajax的新手,在一个页面中有多个Ajax可以吗?

php ajax json

14
推荐指数
2
解决办法
1万
查看次数

Bootstrap 3按钮组

**Bootstrap 3

我试图使每组按钮组都是唯一的,但不同的组互相干扰

<label>Payment Mode</label>
<div class="btn-group">
  <button type="button" class="btn btn-default">Cash / Cheque / Bank Transfer </button>
  <button type="button" class="btn btn-default">JobsBuddy Disbursement</button>
</div>

<label>Payment Period</label>
<div class="btn-group">
  <button type="button" class="btn btn-default">Immediate</button>
  <button type="button" class="btn btn-default"> More Than 1 day</button>
</div>
Run Code Online (Sandbox Code Playgroud)

我如何在它自己的小组中保持独特性

html twitter-bootstrap twitter-bootstrap-3

13
推荐指数
2
解决办法
3万
查看次数

Selenium Nodejs CHROMEDRIVER路径

试过"npm install selenium-webdriver"我仍然得到下面的错误.知道路径在哪里?

Error: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.
    at Error (<anonymous>)
    at new ServiceBuilder (/var/www/nodejs/node_modules/selenium-webdriver/chrome.js:51:11)
    at getDefaultService (/var/www/nodejs/node_modules/selenium-webdriver/chrome.js:216:22)
    at new Driver (/var/www/nodejs/node_modules/selenium-webdriver/chrome.js:470:32)
    at Builder.build (/var/www/nodejs/node_modules/selenium-webdriver/builder.js:302:14)
    at Object.handle (/var/www/nodejs/node.js:31:4)
    at next_layer (/var/www/nodejs/node_modules/express/lib/router/route.js:103:13)
    at Route.dispatch (/var/www/nodejs/node_modules/express/lib/router/route.js:107:5)
    at c (/var/www/nodejs/node_modules/express/lib/router/index.js:195:24)
    at Function.proto.process_params (/var/www/nodejs/node_modules/express/lib/router/index.js:251:12)
Run Code Online (Sandbox Code Playgroud)

javascript selenium node.js

12
推荐指数
3
解决办法
2万
查看次数

Facebook使用#_ = _后面的URL登录

Facebook登入

  // Get the page we were before
  $redirect = Session::get('loginRedirect', 'hirer/account');   
Run Code Online (Sandbox Code Playgroud)

域名变成了这个

 http://domain.com/hirer/account#_=_
Run Code Online (Sandbox Code Playgroud)

#=背后是什么,我怎么不显示它?

html php facebook facebook-graph-api laravel-4

10
推荐指数
1
解决办法
7720
查看次数

从Mailgun表单PHP中检索附件

如何检索并保存通过Mailgun POST的表单发送给我的附件

以下是一些参数

attachment-1    
{:filename=>"crabby.gif", :type=>"image/gif", :name=>"attachment-1", :tempfile=>#<Tempfile:/tmp/RackMultipart20140707-2-slsrkh>, :head=>"Content-Disposition: form-data; name=\"attachment-1\"; filename=\"crabby.gif\"\r\nContent-Type: image/gif\r\nContent-Length: 2785\r\n"}

attachment-2    
{:filename=>"attached_????.txt", :type=>"text/plain", :name=>"attachment-2", :tempfile=>#<Tempfile:/tmp/RackMultipart20140707-2-sudxuf>, :head=>"Content-Disposition: form-data; name=\"attachment-2\"; filename=\"attached_????.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 32\r\n"}

Content-Type    
multipart/mixed; boundary="------------020601070403020003080006"
Run Code Online (Sandbox Code Playgroud)

php forms post attachment mailgun

7
推荐指数
1
解决办法
2844
查看次数

%LIKE%检索例如.呼叫MEN时的女性数据

  $itemList = DB::table('items')
                ->orderBy('id', 'desc')
                ->where('item_status', 2)
                ->where(function($query) use($queryArr)
                {
                    foreach($queryArr as $uID){
                        $query->whereRaw("tags LIKE '%$uID%'");
                    }
                })->paginate(21);
Run Code Online (Sandbox Code Playgroud)

很长一段时间以来,我一直面临着这个问题.当您进行LIKE搜索时出现的问题是,当它只是例如MEN时,它会抓取女性的数据

主要是因为MEN在女性内部

我也尝试了以下但men没有women数据失败(这种方式一句话)

$query->where('tags', 'LIKE', '%'.$uID.'%');
SELECT 'a word a' REGEXP '[[:<:]]word[[:>:]]';
Run Code Online (Sandbox Code Playgroud)

如何在laravel查询生成器中使用该Word边界查询

试过这个但仍然失败$ query-> whereRaw("tags LIKE REGEXP'[[:<:]] Men [[:>:]]'");

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REGEXP '[[:<:]]Men[[:>:]]')' …
Run Code Online (Sandbox Code Playgroud)

php regex laravel

6
推荐指数
1
解决办法
232
查看次数

在React Native中循环Json和显示

如何循环从Json检索到的结果? 在此输入图像描述

render: function() {
     console.log(this.state.list);
     contents = (
      <View style={ styles.content }>
        <Text>Loaded</Text>

      </View>
     )
     return (
      <View style={ styles.container }>
        <View style={ styles.header }>
        <Text style={ styles.headerText }>XXX</Text>
        </View>
        <View style={ styles.content }>
            { contents }
        </View>
      </View>
    );
  }
Run Code Online (Sandbox Code Playgroud)

javascript json reactjs react-native

6
推荐指数
1
解决办法
1万
查看次数

无头Chrome Node API和Puppeteer安装

在干净的ubuntu 18.04上无头安装chrome的整个过程中,我遇到了很多问题。github上的安装指南不足以提供干净的ubuntu 18.04

以下是一些错误和解答/解决方案,用于设置无头chrome来替代phantomjs。

错误1

(node:23835) UnhandledPromiseRejectionWarning: Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"
    at Launcher.launch owlcommand.com /puppeteer/node_modules/puppeteer/lib/Launcher.js:112:15)
    at <anonymous>
(node:23835) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23835) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js …
Run Code Online (Sandbox Code Playgroud)

headless-browser google-chrome-headless puppeteer

6
推荐指数
2
解决办法
6623
查看次数

Json给301永久移动

在Firefox上,只在Firefox浏览器会弹出,给你一个警告,"这个网页被重定向到新的位置.你想重新发送你输入的新位置的形式."

我没有任何形式,我使用javascript从文本框中提取值

我查了萤火它说PUT /管理/提交扫描/ 301永久移动PUT提交-302扫描发现

我的JS

function submitGoods(){
    var registeredNo = $('input[name=registeredno]').val();
    var weight = $('input[name=weight]').val();
        $.ajax({
            type: 'PUT',
            url: '/admin/submit-scan/',
            data: {
                registeredNo: registeredNo,
                weight: weight,
                _token: csrfToken
            },
            dataType: 'json'
        }).done(function(data){

                data = $.parseJSON(data);
            });

}
Run Code Online (Sandbox Code Playgroud)

我的路线

Route::put('submit-scan', 'Controllers\Admin\DashboardController@putUpdateSubmitScan');
Run Code Online (Sandbox Code Playgroud)

我的控制器

 public function putUpdateSubmitScan()
    {
        if (Request::ajax())
        {
            return Response::json(array('success' => 1, 'data' => "test"));
        }
    }
Run Code Online (Sandbox Code Playgroud)

知道出了什么问题吗?

javascript php json laravel laravel-4

5
推荐指数
1
解决办法
1万
查看次数