str替换problemem代码

时间:2017-03-23 03:19:53

标签: php html

{replace}&name={replace2}&pass={replace3}

我想要运行{{1}}

1 个答案:

答案 0 :(得分:0)

尝试这个并实现正确的命名约定。

$provider = 'clody'; // replace with $_POST['D1']
$replacementText = 't1-text'; // replace with $_POST['T1']
$providers = array(
        'google_drive' => 'https://drive.google.com/file/d/{replace}/view',
        'clody' => 'https://www.cloudy.ec/embed.php?id={replace}',
        'example' => 'http://example.com/log.php?id={replace}&name={replace2}&pass={replace3}'
    );
$url = str_replace('{replace}', $replacementText, $providers[$provider]);
echo "Your url is " . $url;