Jump to content

[SOLVED] putting $class->myFunction into another function?


Northern Flame

Recommended Posts

How could I do this?

I created a class and established a function inside of it

and now want to insert that function into another function.

Will this work?

 

<?php

class noLog{
	var $room;
	var $action;

	function myFunctionContent(){
		echo $room . "<h2>blah blah</h2>\n";
		echo $room . "<p>blah blah blah ". $this->action ." blah.</p>\n";
	}
}

$class = new noLog;
$class->room = $space;
$class->action = $_GET['action'];

function myFunction(){
	global $class;

	echo $class->myFunctionContent();
}

?>

 

will that work? Or is there something I'm doing wrong?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.