title: Check variable if explode-able in PHP
body: <p>Not sure if there is a way to check a variable if it is explode-able or not...</p>
  
  <p>I have a database of city names some are one word cities and some are multiple word cities</p>
  
  <p>EX: Chicago, Los Angeles</p>
  
  <p>I keep getting an error when use "implode" when a city name is one word, so I tried using "count" and using an if statement... not having any luck</p>
  
  <pre><code>$citi = explode(' ', $row['city']);
  $count = count($citi);
  if ($count &gt; 1) {
     $city = implode('+', $citi);
  }
  else {
     $city = $citi;
  }
  </code></pre>