I cannot figure out why I cannot get this variable to register inside this array.
Here is my code
PHP Code:
$thisScript_input = $vbulletin->options['customscript'];
$thisScript_array = explode(",", trim($thisScript_input, ","));
$thisScript_string = "'" . implode("','", $thisScript_array) . "'";
echo $thisScript_string;
if (in_array(THIS_SCRIPT, array($thisScript_string)))
{
echo "YES";
}
I have an input field that accepts script names delimited by commas, so in the input field it would look like this
private,showthread,customscript
when i echo $thisScript_string it shows
'private','showthread','customscript' which is the format that the conditional should accept, but it doesnt work.
It does work if i manually put it in like this
PHP Code:
if (in_array(THIS_SCRIPT, array('private','showthread','customscript')))
{
echo "YES";
}
I want it to be able to accept that variable. Is this possible?