AndyB
Well-known member
I'm creating an add-on where I would like to run a block of code like this:
The variable $smilietext is an array which contains the smilie_text of all the smiles in the xf_smilie table.
The error I get is the following:
No matter how I try to declare parameter 2 as a string I still get the error message.
PHP:
foreach ($smilietext as $substring)
{
$smilie_count += substr_count($input['message'], $substring);
}
The variable $smilietext is an array which contains the smilie_text of all the smiles in the xf_smilie table.
The error I get is the following:
Code:
The following error occurred:
substr_count() expects parameter 2 to be string, array given
XenForo_Application::handlePhpError()
substr_count() in Andy/SmilieCount/ControllerPublic/Post.php at line 63
Andy_SmilieCount_ControllerPublic_Post->actionSave() in XenForo/FrontController.php at line 337
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /home/*/www/forums/index.php at line 13
No matter how I try to declare parameter 2 as a string I still get the error message.