【发布时间】:2022-11-04 20:57:05
【问题描述】:
如何将此编号段落转换为句子数组?
1. The best foods for your cat's diet
2. How to ensure your cat is getting enough nutrients
3. The importance of a balanced diet for cats
4. How to make sure your cat is getting enough water
5. Tips for dealing with finicky eaters
6. How to tell if your cat is overweight
7. The dangers of overfeeding your cat5
期望的输出:
$sentences = [
"The best foods for your cat's diet",
"How to ensure your cat is getting enough nutrients",
"The importance of a balanced diet for cats",
"How to make sure your cat is getting enough water",
"Tips for dealing with finicky eaters",
"How to tell if your cat is overweight",
"The dangers of overfeeding your cat5"
];
【问题讨论】:
-
@DarkBee 它为我工作,如何从句子中删除序列号?像 1. , 2. , 3. .... 我没有找到确切的输出...
标签: php arrays regex preg-split