What do you want to save?
Add Code snippet
New code examples
-
Other 2021-11-12 09:20:36
My favourite use of this function is converting a string to an array, trimming each line and removing empty lines:
<?php $array = array_filter(array_map('trim', explode("\n", $string)), 'strlen'); ?> Although it states clearly that array keys are preserved, it's important to note this includes numerically indexed arrays. You can't use a for loop on ... Add solution