Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Trimming Data Contained In An Array

DZone's Guide to

Trimming Data Contained In An Array

·
Free Resource

function file_trim(&$value, $key)
{ 
   $value = trim($value);
}

$file = file('name.txt');
@array_walk($file, 'file_trim');
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}