Kurinchi Blogger Scribbles …


Posts Tagged ‘var_dump’

Oct 08
2009

PHP: Parse URL encoded GET data

Last updated: October 5th, 2009
<?php
// To build back the URI and to extract the passed parameters, you can use parse_url, parse_string function 
$extract_string = parse_url($pass_string);
echo "<h2>Extracted URI (using parse_url)</h2><br />";
echo "<pre>";
var_dump($extract_string);
echo "</pre>";

// To decode the query string use parse_str function 
parse_str($extract_string["query"], $extract_query);
echo "<h2>Extracted Query String (using parse_str)</h2><br />";
echo "<pre>";
var_dump($extract_query);
echo "</pre>"; 

?>
Jun 14
2009

cakePHP, codeIgniter: simple method to display array data

Last updated: June 17th, 2009

var_dump(), print_r() are commonly used functions to display data that is passed across controllers or views when playing in MVC frameworks. As the printed data stretches as a long string, it may be difficult to manipulate the resultset in most cases.

When programming in CakePHP or CodeIgniter or other MVC frameworks when you do not want to turn on the debugger routine and want to have a clean display of Array Data you can try adding a simple method in the Controller (appController in cakePHP) as follows
(more…)


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict