PHP str_replace is not replacing value
<p>I've been bashing my head against the wall for a couple of days on this, because all indications are that this SHOULD work, so I'm obviously missing something simple. </p>

<p>First I am using a function to grab an array of user submitted comments</p>

<pre><code>function get_id_comment_info($id) {
global $connection;

 $pdo = new PDO('mysql:host='.DB_SERVER.'; dbname='.DB_NAME, DB_USER, DB_PASS);
 $pdo-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo-&gt;exec('SET NAMES "utf8"');     

$sql = "SELECT parks.parkid, parks.state, pcomment.parkid, pcomment.comment, pcomment.logname
FROM parks
LEFT JOIN pcomment
ON parks.parkid=pcomment.parkid
WHERE parks.id = '$id'";
$result = $pdo-&gt;query($sql);
$cominfo = $result-&gt;fetchAll();

return $cominfo;        
}
</code></pre>

<p>Then, inside of a foreach loop which processes each park by id, I am working with the data:</p>

<pre><code>foreach ($display_result as $parkrow) { 
$id = $parkrow['parkid'];
$comments = get_id_comment_info($id);

$cleancom = str_replace("'", '', $comments);

print_r($cleancom);

.
.
.
}
</code></pre>

<p>The output for $cleancom is:</p>

<blockquote>
  <p>Array ( [0] => Array ( [parkid] => 462 [0] => 462 [state] => KS [1] =>
  KS [2] => 462 [comment] => I have noticed some others here say don't
  waste your time, but I think it's ok. Yes, it's smaller than most, but
  there is fun to be had if you are an avid rider. [3] => I have noticed
  some others here say don't waste your time, but I think it's ok. Yes,
  it's smaller than most, but there is fun to be had if you are an avid
  rider. [logname] => John32070 [4] => John32070 ) )</p>
</blockquote>

<p>It does not remove the '. If I use preg_replace then the output is simply blank. I am missing something simple, but I just can't see it!</p>