您好,我想在我的網址中回顯函式 $ipss 而不是“HERE”,但我做不到
<?php $url = "http://api.openweathermap.org/data/2.5/weather?q=HERE&lang=fr&units=metric&appid=b5f11a80423d0d4dae64f1ec1a653edf"; ?>
我試過了,但它不起作用
<?php $url = "http://api.openweathermap.org/data/2.5/weather?q=echo $ipss&lang=fr&units=metric&appid=b5f11a80423d0d4dae64f1ec1a653edf"; ?>
uj5u.com熱心網友回復:
您可以使用.連接運算子將一個值連接成一個字串。
<?php $url = "http://api.openweathermap.org/data/2.5/weather?q=" . $ipss . "&lang=fr&units=metric&appid=b5f11a80423d0d4dae64f1ec1a653edf"; ?>
uj5u.com熱心網友回復:
使用{}雙引號
<?php $url = "http://api.openweathermap.org/data/2.5/weather?q={$ipss}&lang=fr&units=metric&appid=b5f11a80423d0d4dae64f1ec1a653edf"; ?>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/406962.html
標籤:
上一篇:如何逐行讀取在線檔案?
