preg_replace removes multiple “\n”s
问题 How do I remove multiple occurrences of \n from the sample below and replace with just one occurrence of \n ? Basically I just want to remove multiple line breaks and replace them with just one line break. \n\n\n\n\n\n\n\n \n\n \n\n\n\n\n\n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n \n \n \n \n \n \n\n \n\n \n\n \nEDITION: U.S.\n\n \nINTERNATIONAL\n\n \nMÉXICO\n\n \n\n \nSet edition preference\n\n \n\n \n\n \n\n \nSign up\n\n \nLog in\n\n \n\n \n\n \n\n \n\n \n\n\n\n\n\n\n\n\n\n\n\n \n\n \n\n\n