All pastes #620612 Raw Edit

Someone

public text v1 · immutable
·published 2007-07-15 16:57 UTC
rendered paste body
<?php
/** 
*
* @package phpBB3
* @copyright (c) 2005 phpBB Group 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

function testman($str)
{
	$ar = str_split($str);
	$out = '';
	foreach ($ar as $value)
	{
		$out .= '\x' . str_pad(strtoupper(dechex(ord($value))), 2, '0', STR_PAD_LEFT);
	}
	return $out;
}

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

$post_id = request_var('post_id', 0);

$sql = 'SELECT post_text
	FROM ' . POSTS_TABLE . '
	WHERE post_id = ' . (int) $post_id;
$result = $db->sql_query($sql);

$row = $db->sql_fetchrow($result);
var_dump(testman($row['post_text']));

$db->sql_freeresult($result);

?>