public function prepareOptions(array $options)
    {
        $optionPieces = [];
        foreach ($options as $opt => $value) {
            //if it's an array of options, throw them in there as well
            if (is_array($value)) {
                foreach ($value as $optArrayValue) {
                    $optionPieces[] = '--'.$opt.'="'.addslashes($optArrayValue).'"';
                }
            } else {
                $option = null;

                //option exists with no value
                if (is_numeric($opt)) {
                    $option = $value;
                } elseif (!empty($value)) {
                    $option = $opt.'="'.addslashes($value).'"';
                }

                if (!is_null($option)) {
                    $optionPieces[] = '--'.$option;
                }
            }
        }

        return implode(' ', $optionPieces);
    }
public function prepareOptions(array $options)
    {
        $optionPieces = [];
        foreach ($options as $opt => $value) {
            //if it's an array of options, throw them in there as well
            if (is_array($value)) {
                foreach ($value as $optArrayValue) {
                    $optionPieces[] = '--'.$opt.'="'.addslashes($optArrayValue).'"';
                }
            } else {
                $option = null;

                //option exists with no value
                if (is_numeric($opt)) {
                    $option = $value;
                } elseif (!empty($value)) {
                    $option = $opt.'="'.addslashes($value).'"';
                }

                if (!is_null($option)) {
                    $optionPieces[] = '--'.$option;
                }
            }
        }

        return implode(' ', $optionPieces);
    }
public function prepareOptions ( array $ options ) { $ optionPieces = [ ] ; foreach ( $ options as $ opt => $ value ) { //if it's an array of options, throw them in there as well if ( is_array ( $ value ) ) { foreach ( $ value as $ optArrayValue ) { $ optionPieces [ ] = '--' . $ opt . '="' . addslashes ( $ optArrayValue ) . '"' ; } } else { $ option = null ; //option exists with no value if ( is_numeric ( $ opt ) ) { $ option = $ value ; } elseif ( ! empty ( $ value ) ) { $ option = $ opt . '="' . addslashes ( $ value ) . '"' ; } if ( ! is_null ( $ option ) ) { $ optionPieces [ ] = '--' . $ option ; } } } return implode ( ' ' , $ optionPieces ) ; }
Prepare a command's options for command line usage

@param array $options

@return string
Prepare a command s options for command line usage