PHP Curl:如何传递变量? - 初学者问题;-)
晚上好亲爱的社区。
我需要一个起点!一个德国数据库,收集来自所有德国基金会的所有数据...
<?php
//
// The PHP curl module supports the received page to be returned in a variable
// if told.
//
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://www.suche.stiftungen.org/index.php?strg=87_124&baseID=129&PHPSESSID=efd25e89a4986cb0981c602fc7c68780");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);
?>
问题: 在这里,我们找到了德国的所有基金会::8074 个不同的基金会:如果您在搜索字段中选择 % 作为通配符,您将获得完整的结果。如何使用 PHP 执行此操作:我认为我们必须使用 curl 或 file_get_contents_ 来执行此操作 - 这些是执行此操作的最佳方法:您个人认为如何。我很想知道你的想法!请。让我知道你的想法!?顺便说一句 - 可能 - 也可以使用 XPATH 和 DOM 技术。大概吧!?
第一种方法: 在此处查看此网址 - 只需单击它查看一个搜索页面
获取这个数据库的方法是搜索(在搜索字段中)字母组合,例如“ac”并选择仅搜索标题。然后浏览每一对字母。如果您仍然得到太多特定对的结果,请使用 3 个字母。 aca,acb,...如果我有一个起点,我会很高兴。
如何放大上面编写的 php 代码...如何将我的方法的变量放入 php 程序...!? 我需要将变量作为字母组合(例如“ac”)传递,并选择仅搜索标题。 然后我必须解析结果 - 然后我必须检查每一对字母。
期待您的来信...
零
good evening dear community.
I need a starting-point! A German DB that collects all the data from all German Foundations...
see this url here - just click it to see a search page
<?php
//
// The PHP curl module supports the received page to be returned in a variable
// if told.
//
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://www.suche.stiftungen.org/index.php?strg=87_124&baseID=129&PHPSESSID=efd25e89a4986cb0981c602fc7c68780");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);
?>
Question: Here we find all Foundations in Germany: : 8074 different foundations: You get the full results if you choose % as wildcard in the Search-field. How to do this with PHP: i think that we have to do this with curl or with file_get_contents_ - those are the best methods for doing this: What do you think, personally. I am curious to get your ideas to know! please. lemme know what you think!? BTW - probably - the XPATH and DOM-Technique can be used too. I guess so!?
First approach: see this url here - just click it to see a search page
The way to get through this database is to search (in the search-field) combinations of letters eg "ac" and select search only titles. Then go through every pair of letters. If you still get too many results for a particular pair, use 3 letters. aca, acb,...If i would have a startingpoint i would be happy.
how to enlarge the above written php-code... how to get the variables of my approach into the php-programme...!?
I need to pass the variables as combinations of letters eg "ac" and select search only titles.
Then i have to parse the results - then i have to go through every pair of letters.
look forward to hear from you...
zero
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要在 URL 中使用 % 作为参数值,则需要使用
urlencode
对其进行转义。If you want to use % as parameter value in an URL, you need to escape it with
urlencode
.