下面是我在DEV环境下成功的HTTP请求:
$response = Http::withHeaders([
'Content-Type' => 'application/json',
'Accept' => 'application/json'
])
->withToken('xxxxxxxxxxxxxx')
->post('https://xxxxxxxxx.com/v0.1/messages/', [
'from' => [
'type' => 'xxxx',
'number' => 'xxxxxxxx',
],
'to' => [
'type' => 'xxxxx',
'number' => 'xxxxxx',
],
'message' => [
'content' => [
'type' => 'text',
'text' => 'test message from laravel'
]
]
]);
Run Code Online (Sandbox Code Playgroud)
但在生产中,必须向请求添加代理。
有人知道如何通过上述请求传递代理吗?先感谢您。
我有一个具有以下结构的二维数组
array = [
["2019-03-11","00986587","LBP"],
["2019-02-23","00462421","USD"],
["2019-05-26","00357853","EUR"],
["2019-09-15","00357382","LBP"]
]
Run Code Online (Sandbox Code Playgroud)
我想根据日期(每行的第一个元素)对数组进行排序。
寻找以下结果:
array = [
["2019-09-15","00357382","LBP"],
["2019-05-26","00357853","EUR"],
["2019-03-11","00986587","LBP"],
["2019-02-23","00462421","USD"]
]
Run Code Online (Sandbox Code Playgroud)
在对sort和sort_by进行研究之后,我没有找到任何解决方案。谁能帮我解决我的问题?谢谢你