Archive for the ‘Web Development’ category

Deleting array element by key in PHP

March 26th, 2009

I had to think about this one for a while, as I was trying to delete an array element which I knew the key of (and there is no array_delete() function).

1
e.g. $array['something'] = 'value';

Turns out deleting the value is easy using the unset() command.

1
unset($array['something']);

$array['something'] no longer exists. Hope this helps someone else.

Showing .htaccess files in Transmit FTP

December 22nd, 2008

I’ve been trying to work this one out for ages, but I’ve finally figured it out. I always like to be able to edit my .htaccess files, but seeing as they are hidden files, Transmit FTP would never show them. I always ended up going back to my PC and using CuteFTP Pro.

Turns out there is a simple option to show hidden files such as .htaccess in Transmit FTP. Simply select View -> Show Invisible Files.

So simple! I can’t believe I have missed this option all this time.