I'm trying to remove extra lines between the texts and here is what I tried:
<?php
echo preg_replace("/^\s+/", "\n", $_POST["description"]);
The input:
The output:
I tried the same regular expression on regex101 and here is the result:
As you can see nothing changed when I executed the regular expression using PHP, But it is working as what I want when using the regex101 website.
The current PHP version is 7.4.28.
Did I miss something?


