Welcome Guest, Not a member yet? Register   Sign In
PHP unset
#1

[eluser]romenov[/eluser]
Hello all,

I am trying to delete a file from my server (currently hosted localy)
but when I use unset() within a certain function in my controller, it gives the following error:

Parse error: syntax error, unexpected T_UNSET


The code:
Code:
function deleteimage($id)
{
$return = unset(base_url() . $product["thumbnail"]);
}
(I stripped the rest out to check if that was causing the error but it isn't)

Any help would be welcome Smile

thanks in advance
#2

[eluser]Gorazd Reichman[/eluser]
You should try this
Code:
function deleteimage($id)
{
$return = unlink(base_url() . $product["thumbnail"]);
}
#3

[eluser]romenov[/eluser]
[quote author="Gorazd Reichman" date="1232853544"]You should try this
Code:
function deleteimage($id)
{
$return = unlink(base_url() . $product["thumbnail"]);
}
[/quote]

ah .. unset is for variables of course! many thanks!




Theme © iAndrew 2016 - Forum software by © MyBB