2012-05-18 39 views
0
$myFile = "testFile.txt"; 
$fh = fopen($myFile, 'w'); 

fwrite($fh, $contact_first_name);   



$result = user_profile_xml($data); 

echo '<br>begin response:<br>'; 
echo '<pre>'; 
var_dump($result); 
echo '</pre>'; 
echo'<br>end response<br>'; 

我想寫var_dump($ result);到文本文件

+0

並讀取該函數的手冊頁包含你的答案(如果還沒有,在過去X年變化):HTTP ://php.net/var_dump – hakre

回答

1

嘗試PHP5: 類X { ... }

$obj = new x(); 

    ob_start();    // open data buffer for echoed data 
    var_dump($obj); 
    $var = ob_get_clean(); // return "echoed" data and free buffer