|
I'd just do a regex replace using preg_replace to get it done in a single line of code.
|
# ¿ Sep 26, 2023 23:13 |
|
|
# ¿ May 7, 2024 22:32 |
|
I hate looping over strings by line so I'd do:php:<?php $file_contents = file_get_contents($filename); $new_file_contents = preg_replace('/(^\s+)|(\s+$)/', '', preg_replace('/\s*\|\s*/', '|', $file_contents)); Mind_Taker fucked around with this message at 05:05 on Sep 28, 2023 |
# ¿ Sep 28, 2023 04:54 |