第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

將在 ajax 調(diào)用中工作的 Strtotime 函數(shù)

將在 ajax 調(diào)用中工作的 Strtotime 函數(shù)

PHP
慕桂英3389331 2021-08-27 09:55:47
我正在嘗試使用 php 中的 strtotime 從多個(gè)選擇框中連接日期和時(shí)間值,但是,我需要在我的 ajax 調(diào)用中使用這個(gè)轉(zhuǎn)換后的時(shí)間戳變量。編碼:    <form>    <select id="month">        <option value="1">January</option>    </select>    <select id="day">        <option value="22">22</option>    </select>    <select id="year">        <option value="2020">2020</option>    </select>    <select id="time">        <option value="12:00:00">12:00</option>    </select>    <button id="submitNow"></form>$("#submitNow").click(function(e){         e.preventDefault();        var timestamp = /*need to basically do strtotime($month . "-" . $day . "-" . $year . " " .  $time) */        var promises = [];        var promise;        $.when.apply($, promises).then(function() {            $.ajax({               type:'POST',               url:'url/test',               data:{timestamp:timestamp},               _token: '{{ csrf_token() }}',               success:function(data){                    window.location.href = "/library";               }          });    });});所以基本上,在 PHP 中,我可以轉(zhuǎn)儲(chǔ)strtotime($month . "-" . $day . "-" . $year . " " .  $time)并獲取 1-22-2020 12:00:00 的 unix 時(shí)間戳,但我需要以某種方式(在 Laravel 中)執(zhí)行此操作,以便我可以在我的 ajax 中提交時(shí)間戳 (1548158400)稱呼我能做到這一點(diǎn)的最佳方法是什么?
查看完整描述

1 回答

?
米脂

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超3個(gè)贊

Blade 仍然只是一個(gè) php 文件(name.blade.php),所以你應(yīng)該能夠做到這一點(diǎn)。

var timestamp = <?php echo strtotime($month . "-" . $day . "-" . $year . " " .  $time); ?>



查看完整回答
反對(duì) 回復(fù) 2021-08-27
  • 1 回答
  • 0 關(guān)注
  • 173 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)