Can I call a class inside a function?


Posted on 16th Feb 2014 07:03 pm by admin

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

Code: [Select]<?php
<?php
require_once("image_load.php");
...
....

function image_upload($tmp_name,$imgid){

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

No comments posted yet

Your Answer:

Login to answer
146 Like 19 Dislike
Previous forums Next forums
Other forums

Procedure with variable number of columns
Hi, I have a procedure that looks like this:

PROCEDURE PROC(p_cursor OUT sys_refcurso

Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing

Help Ordering Arrays
Hi, I have 3 arrays as shown below.

Code: $users = $this->get_latest_users();
$flir

How to sum these output values
Hi

I need sum the month totals
SELECT region_name, area_name ,SUM (CASE WHEN S

Mail Form receiving emails with no content
Hi, I hope someone here can help me.
I have a simple form in my website, it was working OK, after

post to self
Trying to get my form to submit to itself. However I am also trying to use an image for my submit bu

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

How to show more than 1 users with this code...
Hello,
i have a table that shows users only if I, as Administrator, want to be shown. But its sho

Retrieving the 25 most recently added entries from all tables in a MySQL databas
Hello,

The code below works great. It creates a table that shows the 25 most recently added t

ME54/ME54N Conditional check for Release of PR
Hi Gurus,

My requirement is to put a check on the release of the PR with respect to the c

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash