This function doesn't have a return, so if you want to do something with it you'll have to do something like
<?php
function pdo_debugStrParams($stmt) {
ob_start();
$stmt->debugDumpParams();
$r = ob_get_contents();
ob_end_clean();
return $r;
}
// omitted: connect to the database and prepare a statement
echo '<pre>'.htmlspecialchars(pdo_debugStrParams($stmt)).'</pre>';
?
Source: http://stackoverflow.com/questions/22157331/something-like-debugdumpparams-in-pdo-settable-to-a-string