Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9207069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:18:35+00:00 2026-06-18T00:18:35+00:00

I am, for fun, trying to make it able to give an array some

  • 0

I am, for fun, trying to make it able to give an array some options and then implode the array into a string which can be used with the WideImage class. But I am having troubles. It’s like it’s actually not possible.

My code is following:

$options = array('resize'=>'50,50');

$actions = implode('->', $options);
$img = WideImage::load($image) . $actions . ';';

This would make a string like:

WideImage::load('../images/photo.jpg')->resize(50,50);

What I am searching for from you guys, is to tell me if this is possible at all.

UPDATE

When I am using eval() I am getting an error that the methods given to the wideimage class is undefined property.

Here is my code:

$actions = 'resize(50,50)';
return eval('WideImage::load($image)->$actions->saveToFile('path/to/file')');

This gives me an error of undefined property, and says that saveToFile() is member of a non-object. But if I hardcode the resize and don’t use $actions it’s actually working. What am I doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:18:36+00:00Added an answer on June 18, 2026 at 12:18 am

    call_user_func_array is perfect for this, but you would need to refactor a few things.

    $options = array('method' => 'resize', 'parameters' => array(50, 50));
    $obj = WideImage::load($image);
    call_user_func_array(array($obj, $options['method']), $options['parameters']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some fun with, copy/pasting code into textarea and then trying to make
Here's a fun little script I'm trying to make. Flash words from an array
I'm trying to make a jquery plugin (just for fun) and I can't seem
Am pretty new to Animation development.Am trying to make a fun application in which
I'm having some fun trying to pick a decent SQL Server 2008 spatial index
So I am trying to make a fun and interactive navigation on my new
I'm trying to make a simple msn client mostly for fun but also for
Now I have been trying for fun to make my own version of the
I'm trying to make a standard ml function which takes 3 elements as input
Just for fun I created a mandelbrot program. I'm now trying to make it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.