If you're using MAMP Pro, editing the php.ini file directly results in it being overwritten when MAMP Pro restarts. I had to edit through the MAMP Pro GUI to turn off 'magic_quotes_gpc'.
In MAMP Pro, go to
File > Edit Template > PHP > [The PHP you're using, in my case PHP 5.3.14 php.ini]
(img link: https://i.stack.imgur.com/ToUqF.png).
There, you can look for 'magic_quotes_gpc = On' and set that to 'magic_quotes_gpc = Off'. Save the file and restart MAMP Pro.
If you only see 'magic_quotes_sybase = Off', which happened to me, I modified it with these lines:
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off
(img link: https://i.stack.imgur.com/HsyPw.png)
Hope that helps!