I am using simple php unset() function to remove and index of array but it's showing error
Parse error: syntax error, unexpected 'unset' (T_UNSET)
Error. here is the syntex
echo $totalArray = unset($linkExtHelp[0]);
Thanks in advance.
I am using simple php unset() function to remove and index of array but it's showing error
Parse error: syntax error, unexpected 'unset' (T_UNSET)
Error. here is the syntex
echo $totalArray = unset($linkExtHelp[0]);
Thanks in advance.
Try this, Reason for unset($linkExtHelp[0]) assigning to the variable echo $totalArray =
You can't assign the unset() value to the variable, You can use to check before unset and after unset as like below. In other words, unset does not have any return value, since unset is a void. Void - does not provide a result value to its caller.
Syntax: void unset ( mixed $var [, mixed $... ] )
echo "Before unset:",$linkExtHelp[0];
unset($linkExtHelp[0]);
echo "After unset:",$linkExtHelp[0];
instead of
echo $totalArray = unset($linkExtHelp[0]);