Webmastersite.net
Register Log In

creating a function

Title creating a function
Description to be called from template
Message Text Paul,

I'm inserting the following function in commonfuncs.php :

function replaceemail($email_original)
{
if ($email_original)
{
$email_replaced = str_replace('@', '[at]', $email_original);
$email_replaced = str_replace('.', '[dot]', $email_replaced);
return $email_replaced;
}
}

The difficulty arises when I call it from the template as:

{FUNC_ REPLACEEMAIL[{LINKEMAIL_COMPANY}]}

The following warning arises:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'replaceemail' was given in D:\xampp\htdocs\tests\companies\templatefunctions.php on line 115

What can be the cause of this warning ?

Before this I had this function directly inside the template but when somebody inserts a " character a lot of errors arises because of the broken php code,
so I want to call the function but not have the code inserted in the template.

Best Regards
Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership peumus
Views 699 views. Averaging 0 views per day.
Similar Topics
Submission Date Jan 18, 2007 - 8:19 PM