Breaking News
Home / Web / PHP / PHP Snippets / How to trim white spaces of array values in php?

How to trim white spaces of array values in php?

I have the following array with white spaces.

$values = array(‘ one ‘,’two ‘,’ three ‘);

and I want it like

$values = array(‘one ‘,’two’,’three ‘);

Any idea?

[pb_builder]

Check Also

How to list files in a directory in PHP?

<?php if ($handle = opendir(‘/path/to/directory’)) {     echo "Directory handle: $handlen";     echo …

Advertisment ad adsense adlogger