【发布时间】:2014-09-01 14:53:35
【问题描述】:
我是 PHP 新手。
例如,我有一个不同名称的测试文件“names.txt”;
Maddox
Magnus
Malcolm
Melvin
Marcus
Mark
Marlon
Martin
Marvin
Matthew
Maurice
Max
Medwin
Melville
Merlin
and so on to 100s
我希望这些名称与 URL 一样位于另一个或相同的 TXT 文件中。
<a href="http://example.com/Maddox/something/">Maddox</a></br>
<a href="http://example.com/Magnus/something/">Magnus</a></br>
<a href="http://example.com/Malcolm/something/">Malcolm</a></br>
<a href="http://example.com/Melvin/something/">Melvin</a></br>
<a href="http://example.com/Milburn/something/">Milburn</a></br>
<a href="http://example.com/Marvin/something/">Marvin</a></br>
<a href="http://example.com/Melville/something/">Melville</a></br>
<a href="http://example.com/Montague/something/">Montague</a></br>
and so on to the all names of txt file.
我无法手动完成 100 次,所以问题是我如何使用 PHP 来做到这一点?
你能为此编写一个 PHP 代码吗?
非常感谢。
【问题讨论】:
-
你(甚至)尝试过to read the manual 吗?
-
是的,但不明白。这就是我问的原因。
-
我已阅读规则并尝试过但忘记了循环。得到提示,感染答案。
标签: php