parse_str 只返回第一个参数

时间:2021-02-17 08:57:34

标签: php

所以我写了一些应该简单的代码

title=title&description=description&image=(some image here)&color=ff0000

然后返回这个

echo $meta["title"] //title
echo $meta["description"] //description
echo $meta["image"] //(some image here)
echo $meta["color"] //ff0000

相反,它只是出于某种原因返回标题......

<?php
    $url = $_SERVER["REQUEST_URI"];
    $url = substr($url, 2);
    $url = base64_decode($url);
    // title=title&description=description&image=(some image here)&color=ff0000
    // confusing part
    parse_str($url, $meta);
?>

1 个答案:

答案 0 :(得分:0)

这样的事情呢?

x₀

打印出来的内容:

x

而不是重新发明轮子:) (thx @u_mulder)

julia> default(markerstrokecolor = "white", linewidth = 2);

julia> scatter(f, -3:0.1:3, label = "f(x) = -x² - 1", xlabel = "x", ylabel = "f(x)");

julia> scatter!([1], [f(1)], label = "", markersize = 10);

julia> plot!(gradient_line(f, 1), 0:0.1:3, label = "f'(1)", color = 2);

julia> scatter!([-2], [f(-2)], label = "", markersize = 10, color = 3);

julia> plot!(gradient_line(f, -2), -3:0.1:0, label = "f'(-2)", color = 3)