如题,我用的是phpstorm,我看所有的xdebug教程都只是针对单独的php文件如:
<?php
$str1="str2.jpg";
$str2="str10.jpg";
echo strcmp($str1, $str2);
echo strnatcmp($str1, $str2);
?>
这种能独立运行的,但是我接触到很多php代码是嵌入到html文件里,或被html包含的,如下 index.php
<body>
<center>
    <label>请选择上传的图片 .jpg:</label>
    <form action="newPhp.php" method="post" enctype="multipart/form-data">
        <input type="hidden" name="action" value="upload"/>
        <input type="file" name="u_file"/>
        <input type="submit" value="上传"/>
    </form>
</center>
</body>
</html>嵌入的newPhp.php:
<?php
if ($_POST['action']=="upload")
{
    $file_path = "./uploads\\";
    $picture_name = strstr($picture_name, ".");
    echo $picture_name;
    if ($picture_name!=".jpg")
    {
        echo "<script>alert('上传图片格式不正确,请重新上传');window.location.href='index.php';</script>";
    }
    else if ($_FILES[u_file][tmp_name])
    {
        move_uploaded_file($_FILES[u_file][tmp_name], $file_path.$_FILES[u_file][name]);
        echo "上传成功";
    }
    else
        echo "上传失败";
}
?>
我在那newPhp.php 的if ($picture_name!=".jpg")里下断点,然后xdebug从index.php启动调试结果无法在断点中断,但是普通单个php文件却可以断点调试,请问这是怎么回事呀,这种嵌套的或混编调试该怎么搞呀,新人求教中。