public function load($data)
    {
        // Turn current string into an array using provided separator
        $values = explode(',', $data);

        // If empty string is passed, then explode() returns false
        if ($values === false) {
            $values = array();
        } else {
            // Remove empty values from current array we have
            array_walk($values, function($value, $key) use (&$values) {
                if (empty($value)) {
                    unset($values[$key]);
                }
            });
        }

        // Done
        $this->values = $values;
    }
public function load($data)
    {
        // Turn current string into an array using provided separator
        $values = explode(',', $data);

        // If empty string is passed, then explode() returns false
        if ($values === false) {
            $values = array();
        } else {
            // Remove empty values from current array we have
            array_walk($values, function($value, $key) use (&$values) {
                if (empty($value)) {
                    unset($values[$key]);
                }
            });
        }

        // Done
        $this->values = $values;
    }
public function load ( $ data ) { // Turn current string into an array using provided separator $ values = explode ( ',' , $ data ) ; // If empty string is passed, then explode() returns false if ( $ values === false ) { $ values = array ( ) ; } else { // Remove empty values from current array we have array_walk ( $ values , function ( $ value , $ key ) use ( & $ values ) { if ( empty ( $ value ) ) { unset ( $ values [ $ key ] ) ; } } ) ; } // Done $ this -> values = $ values ; }
Loads data from a string

@param string $data
@return void
Loads data from a string