douhao9203 2017-09-19 12:21
浏览 42
已采纳

php从字符串中删除单词[关闭]

Suppose i have the following strin

assigned order 1234

I would like to remove the words

assigned order

So my final output should be

1234

How do i go about this in php

SO something like

$string = "assigned order 1234";

$newstring = //stuck here

NOte that the value 1234 can also be 767as33 BUT THE PART assigned order always remains constant

  • 写回答

2条回答 默认 最新

  • doubihuai8468 2017-09-19 12:28
    关注

    I would break into array of word, than take the last array item.

    $words = explode(' ', $text); $orderno = end($words);

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部