php - How i can make some variables in a url and a text $u1.txt
问题描述
I have a url that already has some variables:
api/search.php?name=Carl&name2=Carlos
but I copy that to explode the data in arrays to save it in a txt file like
I try
$var_c = implode ('', file ('https://awebsite/api/search.php?name=$Variable1&name2=$variable2"'));
but i have not the variables in the url the request is 0
then the txt file must save a file from a other Variable
$dateiA = "test.txt";
I try
$dateiA = "$test.txt";
the variables not working at all
Does anyone have an idea? thx a lot.
解决方案
我不完全理解这个问题,但我认为你需要的是:
您可以像这样访问 URL 参数:
$urlParameters = $_GET;
你会得到一个如下所示的数组:
array(
'name' => 'Carl',
'name2' => 'Carlos',
)
推荐阅读
- javascript - 将输出添加到每个 for 循环的数组
- javascript - 返回被 Promise 包裹的 fetch 和返回 fetch 一样吗?
- go - Golang:从切片中删除超过 1h 的结构
- sql-server-2012 - 删除临时表但已经建立'数据库中已经有一个名为'#temp'的对象'
- python - 无法清除 dict:keys 中的空格和 \n 字符
- javascript - 全局对象 `window` 和 `document` 的类型是什么?
- sql - 收到错误“回滚事务请求没有相应的开始事务”
- html - 从空的类标签 (HTML) 中抓取
- crud - CakePHP3 CRUD API 和 API 路由
- java - 用单独的颜色显示国家