title: save array with commas in ternary condition php
body: <p>I have an array </p>
  
  <pre><code>$this-&gt;input-&gt;post("first_array")={ one two three }
  </code></pre>
  
  <p>I need to create an array which will hold several arrays like that</p>
  
  <p>so I am doing a 'fisrt_array' to hold the array, first verifiying that it is indeed an array, then if it is not set I put a 'not defined' string </p>
  
  <pre><code>array(
  'fisrt_array' =&gt; is_array($this-&gt;input-&gt;post("first_array")) ? implode(' ',$this-&gt;input-&gt;post("first_array"))   : 'Not defined'
  );
  </code></pre>
  
  <p>So if it is set, I implode the array that is saved in $this->input->post("first_array")</p>
  
  <p>All is correct but I store the result like <strong>one two three</strong>  instead of <strong>one,two,three</strong> </p>
  
  <p>How can i save the array in that format?</p>
  
  <p>If i do <code>implode(',',$this-&gt;input-&gt;post("first_array")</code> i would store <strong>one,two,three,</strong> with last not wanted comma..</p>