Jump to content

String Manipulation Help


maecro

Recommended Posts

Hey guys having a problem with the following code which is supposed to change the case of the class name and include the resulting file.

 

	
function __autoload($class_name) {
$class_name = strtolower($class_name);
$class_name .= ".php";
include $class_name;
}

 

However this throws the following error Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE on

 

$class_name .= ".php";

 

I cannot figure out why I cannot append the string to the result of strtolower, can anyone tell me what's wrong?

 

Link to comment
https://forums.phpfreaks.com/topic/218281-string-manipulation-help/
Share on other sites

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.