doute7910 2013-02-16 09:21
浏览 36
已采纳

删除单个字符串中的字符

example:

  $name1="abcdefg";
  $name2="csawea";

Output: bdfgsw

i want to make a php code that removes all the same characters and its duplicate that is in Input1 and Input2, im new in PHP so im kinda confused in the codes, i know the strrpos,substr func but i need to see a finish product in order to understand the flow. TNX!!

other ex:

$name1= "aaabb";
$name2= "bccc";

Output: aaaccc
  • 写回答

1条回答 默认 最新

  • 普通网友 2013-02-16 09:24
    关注

    Use preg_match(); or str_replace();.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?