dongwang788787 2014-11-30 04:56
浏览 26
已采纳

如何格式化PHP函数返回的字符串[关闭]

I wrote a program that uses an ISBN to query Amazon for that ISBN's price, and returns the following result:

5cb66919-8a8d-4c13-9175-790f0476508d0.0401580000000000TrueISBN9780340979266OffersAllAll0340979267809USD$8.09688USD$6.88598USD$5.98241010000

I need to format this so that I have the price information in a format that would be understandable to a human.

How can I do this?

  • 写回答

2条回答 默认 最新

  • dongxue7306 2014-11-30 09:13
    关注

    Use this way..

    <?php
    $s = '5cb66919-8a8d-4c13-9175-790f0476508d0.0401580000000000TrueISBN9780340979266OffersAllAll0340979267809USD$8.09688USD$6.88598USD$5.982410100000';
    $p = explode('USD',$s);
    echo "<pre>";
    print_r($p);
    echo "</pre>";
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?