Contact Us


Remove Duplicate Lines

by bill - 2025-03-08 12:42:33 ( in education, tech, computers, software) [php version] rebuild

I created this because I needed it regularly, and thought I'd share. Click here to run it, and look below to make one for yourself:


Remove Duplicate Lines

Remove Duplicate Lines



if (isset($_POST['submit'])) {

$inputText = $_POST['inputText'];

$lines = explode("\n", $inputText); // Split the input into lines

$uniqueLines = array_unique($lines); // Remove duplicates

$resultText = implode("\n", $uniqueLines); // Join lines back together

echo "

Result:

";

echo "";

}

?>


similar posts here ... and elsewhere

Comments (We enjoy free speech. Try not to offend, but feel free to be offended.)

Leave your own comment:

edit · rebuild · update · hide · [find/set image] [empty]

 

You might also like: Dievna Photography · HepYa · Holmes Family Newsletter · Lazy Pug Cafe · Tara's Faves · William Arthur Holmes · substack · contact