0
我試圖在php var中替換一個單詞,但它並不按我嘗試的方式工作。在php中替換word var
這裏是我的代碼:
iframe.src = '<?php echo $app->url("Widget:iframeContent") ?>&domain=' + document.domain;
它會返回此:
http://127.0.0.1/livechat/php/app.php?widget-iframe-content&domain=' + document.domain
這裏是我的嘗試:
iframe.src = '<?php echo str_replace("http", "https", $app->url)("Widget:iframeContent") ?>&domain=' + document.domain;
我想要做的就是更換HTTP與https,但我找不到辦法。
你找不到'str_replace()'函數? – Barmar
什麼是「我嘗試的方式」?我沒有看到任何試圖替換一個字。 – Barmar