Page 1 of 1

Print array :)

Posted: Thu May 08, 2014 12:29 pm
by session
Simple as that, how i can print out the values into a index.php page. I have autoloadclass for loading classes.

Code: Select all

<?php
class init{

 public function __construct(){
		$array = array(
		 
			'session' => array
			(
				'session_id' => '',
				'session_name' => '',
			),
			'cookie' => array
			(
				'cookie_id' => '',
				'cookie_name' => '',
			),
			'mysql' => array
			(
				'host' => ' ',
				'username' => ' ',
				'password' => ' ',
				'database' => ' ',
			)
		);
		return $array;
	}
}
?>

Re: Print array :)

Posted: Thu May 08, 2014 12:40 pm
by Celauran
Constructors don't return values, they instantiate the class. What are you trying to do?

Re: Print array :)

Posted: Thu May 08, 2014 1:08 pm
by session
Just to print multidimensional array from class file.

Re: Print array :)

Posted: Fri May 09, 2014 4:11 pm
by pickle
print_r() or var_dump()