【问题标题】:Create strings to multi relation keywords为多关系关键字创建字符串
【发布时间】:2019-12-05 11:20:31
【问题描述】:

我需要从字符串中为搜索词创建一个多关系关键字数组。 例子: String is Like: Armitage Portable Wireless Powerbank with Suction

我需要一个类似的输出

1) Armitage
2) Portable
3) Wireless
4) Powerbank
5) Suction
6) Armitage Portable
7) Armitage Wireless
8) Armitage Powerbank
9) Armitage Suction
10) Portable Wireless
11) Portable Powerbank
12) Portable Suction
13) Wireless Powerbank
14) Wireless Suction
15) Powerbank Suction
16) Armitage Portable Wireless
17) Armitage Portable Powerbank
18) Armitage Portable Suction

等等……

【问题讨论】:

  • 所以你想创建排列。请使用它作为(重新)搜索关键字,到目前为止,您不是第一个要求这样的人。
  • 这能回答你的问题吗? Generating all permutations of a given string
  • 不,我需要在 PHP 中,我需要用单词而不是字符来分割。
  • 谢谢我实现了这个逻辑,它工作正常。

标签: php arrays string search split


【解决方案1】:

您可以尝试使用以下示例:

explode(" ", $string)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多