【问题标题】:PHP function. Use function from another functionPHP 函数。使用另一个函数的函数
【发布时间】:2016-04-18 00:51:49
【问题描述】:

我有一个 php 函数的问题,或者我需要知道如何(或如果工作)可以使用:

<?php
$_POST["search"] = substr($_POST["search"], -11);
echo $_POST["search"]
?>

我想在这里使用搜索 echo $_POST['search'] 的结果:(进入其他 php 函数。

<?php
$content = file_get_contents("http://youtube.com/get_video_info?video_id=".$HERE);
parse_str($content, $ytarr);
echo $ytarr['title'];
?>

.$HERE 在哪里我想放置搜索结果函数。如果有人在第二个代码中提交了 INWR29242jr(示例)的帖子,我希望得到第一个结果。

我希望我已经足够清楚了。我是业余的,但我想学习。 谢谢!

【问题讨论】:

  • $content = file_get_contents("http://youtube.com/get_video_info?video_id=" . substr($_POST["search"], -11))?
  • 工作。太感谢了。很容易。 :D

标签: javascript php jquery mysql post


【解决方案1】:

只需将$HERE 替换为substr 返回的结果即可:

$content = file_get_contents("http://youtube.com/get_video_info?video_id=" . substr($_POST["search"], -11))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-19
    • 1970-01-01
    • 1970-01-01
    • 2013-08-10
    • 1970-01-01
    • 2012-03-03
    • 1970-01-01
    相关资源
    最近更新 更多