我有一个功能
function currency($from_Currency,$to_Currency,$amount) {
成功地回显了结果。
echo currency("USD","INR",1.00),"india.png","\n";
echo currency("USD","EUR",1.00),"europe.png","\n";
echo currency("USD","GBP",1.00),"england.png","\n";
echo currency("USD","AED",1.00),"uae.png","\n";
echo currency("USD","CNY",1.00),"china.png","\n";
echo currency("USD","CAD",1.00),"canada.png","\n";
echo currency("USD","PKR",1.00),"pakistan.png","\n";
echo currency("USD","ZAR",1.00),"southafrica.png","\n";
echo currency("USD","CAD",1.00),"canada.png","\n";
echo currency("USD","JPY",1.00),"japan.png","\n";
echo currency("USD","NZD",1.00),"newzealand.png","\n";
echo currency("USD","NPR",1.00),"nepal.png","\n";
由于只有在函数中传递 USD、INR、EUR... 值时才能返回回声值。我还附加了图像名称。我想用回显值生成 JSON 输出。有人可以给我提供交流的想法吗?
我从回声值得到的输出是这样的
54.42india.png
0.77europe.png
0.65england.png
3.67uae.png
6.17china.png
1.02canada.png
98.48pakistan.png
9.1southafrica.png
1.02canada.png
98.22japan.png
1.18newzealand.png
87.01nepal.png
提前致谢