Monthly Archives: January 2010

PHP var_dump

This function displays structured information about one or more expressions that includes its type and value. Arrays and objects are explored recursively with values indented to show structure.

<?php

$a = array(1, 2, array(“a”, “b”, “c”));
var_dump($a);
?>

Result : –

array(3) {

[0]=>

int(1)

[1]=>

int(2)

[2]=>

array(3) {

[0]=>

string(1) “a”

[1]=>

string(1) “b”

[2]=>

string(1) “c”

}

}

——————————————————————————-

<?php

$b = 3.1;

$c = true;

var_dump($b, $c);

?>

Result: –

float(3.1)

bool(true)

Advertisements

PHP trim

<?php
$text = ” Hello “;
$textlen = strlen($text);
echo “Text is : $text \n”;
echo “Text length before trim : $textlen \n”;
$text = trim($text);
$textlen = strlen($text);
echo “Text length after trim  : $textlen \n”;
?>

Result: –

Text is :  Hello

Text length before trim : 7

Text length after trim  : 5

PHP array_count_values($arr)

array_count_values($arr)
creates a histogram for the values in an array
<?php
$states = array(“MP”,”AP”,”RJ”,”UP”,”MH”,”HM”,”AP”,”RJ”,”MP”,”MH”,”AP”);
$xstates = array_count_values($states);
ksort($xstates);
print_r($xstates);
?>
Result: –
Array
(
[AP] => 3
[HM] => 1
[MH] => 2
[MP] => 2
[RJ] => 2
[UP] => 1
)

3 idiots!


3 Idiots

3 Idiots is a fantastic movie and it is a very touching storyline. It will entertain anyone no matter what you are into or what type of movies you like. This movie contains comedy, emotional moments and much more happyness.

I RECCOMEND THIS MOVIE TO EVERYONE