2016-03-21 14 views
1

私は次のコードを持っている:キャプチャのvar_dump出力

$img_title_display = mysqli_query($db, "SELECT DISTINCT title FROM images WHERE user_id='$user_id' ORDER BY title"); 

while($row = $img_title_display->fetch_assoc()) 
{ 
    var_dump($row['title']); 
} 

をし、出力は次のようである:

string(6) "title1" string(6) "title2" string(6) "title3" string(6) "title4" string(6) "title5" string(6) "title6" string(6) "title7" string(6) "title8" 

それは同じようになるように、私は出力をクリアするにはどうすればよい:TITLE1 TITLE2 TITLE3タイトル4タイトル5タイトル6タイトル7タイトル8?

答えて

0

あなただけのエコー機能を使用する必要があります

0
echo '<pre>'.print_r($row['title'],1).'</pre>'; 

foreach($row['title'] as $title){ 
echo '<pre>'.print_r($title,1).'</pre>'; 
} 
0
$img_title_display = mysqli_query($db, "SELECT DISTINCT title FROM images WHERE user_id='$user_id' ORDER BY title"); 

while($row = $img_title_display->fetch_assoc()) 
{ 
    echo $row['title']; 
} 
関連する問題