Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有这个字符串:
I like bacon but nothing else
我将如何从字符串中提取“培根”?也像这个:
I like jerking around
那一个只会抽搐吗?
谢谢!:)
这可能会涉及正则表达式吗?
$string = "I like bacon but nothing else"; $word = end(explode(" ", $string, 3)); echo $word;
这将从字符串中获取您的第三个单词。