0

hello. I need to dedupe e text. meaning if i have an array with stored strings, it will check and compare each row of array with each other to test if text[i]==text[i+1]. to dot this i thougt to catch the text from an input, ex:text are and consider it as a long string.
then each space between words to be considered as new line and to be entered into the array. sample:
$string1="aa bb cc aa";
what code should i type here so it can become like this:
$array1=array("aa","bb","cc","aa");
and at the end afer dedupet it will posted:
aa
bb
cc

Edited by pritaeas: Added markdown.

2
Contributors
4
Replies
12
Views
4 Years
Discussion Span
Last Post by nstrazimiri
0

thx for the reply. i know array_unique. but i dont know how to insert each part of the string into an array.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.