Home >Backend Development >PHP Tutorial >php的字串符 1/4,如何得出结果

php的字串符 1/4,如何得出结果

WBOY
WBOYOriginal
2016-06-06 20:45:511010browse

抓取的api中有一个(string)1/4

我需要得出结果,请问我要怎么写php

回复内容:

抓取的api中有一个(string)1/4

我需要得出结果,请问我要怎么写php

来个暴力点的

<code class="lang-php"><?php $output = '1/4';
$output = exec('echo 1|awk \'{print '.$output.';}\'');
echo $output;
</code></code>

api是否有规定格式?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn