Jump to content

Can I call a class inside a function?


cooldude832

Recommended Posts

I have a class written in another file that handles my image resizing.

 

Can I do this (php says I can't calling a non-existent class), but I know its there becuase the require doesn't fail above

 

<?php
<?php 
require_once("image_load.php");
...
....

function image_upload($tmp_name,$imgid){

$image = new easyImageEdit();
$image->load(UPLOADS.$tmp_name);
$image->resizeToWidth(250);
}
?>

Link to comment
https://forums.phpfreaks.com/topic/178423-can-i-call-a-class-inside-a-function/
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.