Problem inserting parameters into a function

Posted by SoLoGHoST on Stack Overflow See other posts from Stack Overflow or by SoLoGHoST
Published on 2010-04-30T07:42:49Z Indexed on 2010/04/30 7:47 UTC
Read the original article Hit count: 372

Filed under:
|
|

Ok, I am trying to place parameters into a function that is called like so:

$parameters['function']($parameters['params']);

Here is the function and the parameters that I need to be placed into this:

$parameters['function'] = 'test_error';
$parameters['params'] = array(0 => $txt['sometext'], 1 => 'critical', 2 => true);

The test_error function takes 3 parameters:

  1. The error to output
  2. The type of error noted within a string value ('general', 'critical', etc. etc.).
  3. Whether it should be echoed or not.

Here is the output I get: Here is a test error.ArraycriticalArray1

I know this function works perfect, but it only gives me the 1st parameter returned from it. What am I doing wrong here with the $parameters['params']??

© Stack Overflow or respective owner

Related posts about php

Related posts about parameters