小编Ari*_*ego的帖子

PHP如何比较两个变量之间的字符串并只显示唯一的字符串?

注意:在SO中有很多方法可以使用数组键,在相同变量的值/单词之间,两个不同的数组之间,但我在互联网上看不到字符串之间的任何内容而不是两个不同变量的数组.

<?php
$a = 'this car is very beautiful and is the fast';
$b = 'this red car is very beautiful and is the fast that others';
var_export($unique_words = show_unique_strings($a, $b));
//expected output(painted on the screen): red that others
?>
Run Code Online (Sandbox Code Playgroud)

php string-comparison

-3
推荐指数
1
解决办法
82
查看次数

标签 统计

php ×1

string-comparison ×1