Java 我可以用android编写php代码吗?
我有一些php代码,我想在我的android应用程序中编写这些代码。下面给出了php代码Java 我可以用android编写php代码吗?,java,php,android,html,Java,Php,Android,Html,我有一些php代码,我想在我的android应用程序中编写这些代码。下面给出了php代码 <?php $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $get = file_get_contents("https://www.google.com/finance/conv
<?php
$amount = urlencode($amount);
$from_Currency = urlencode($from_Currency);
$to_Currency = urlencode($to_Currency);
$get = file_get_contents("https://www.google.com/finance/converter?a=$amount&from=$from_Currency&to=$to_Currency");
$get = explode("<span class=bld>",$get);
$get = explode("</span>",$get[1]);
echo $converted_amount = preg_replace("/[^0-9\.]/", null, $get[0]);
?>
我想要字符串中的
$converted\u amount
值。我不知道怎么做。如果我能告诉我怎么做。不,你不能写。但是,如果您非常喜欢php,请创建一个php脚本来编写上述代码,并创建某种HTML页面来在网络视图中显示和加载相同的代码
我没有在java或android上工作过,但你一定有相当于
urlencode
,file\u-get\u-contents
和explode
的东西,在java
中你到底为什么有这样的要求!!!你可以用Android编写PHP代码,但不能保证它能正常工作。我建议用java编写类似的代码。这也将有助于其他任何Android应用程序building@Kedarnath.... 好的,伙计,我只想把美元兑换成当地的货币。因此,如果你有任何货币兑换免费,然后告诉我me@NeilLocketz.. 好的,兄弟,我只是想确认一下这是否可能