I'm trying to programatically create a PHP file:
<?php
if (!empty($_GET['code'])
{
// Do 1
}
else
{
// Do else
}
?>
I've got this:
sudo echo '<?php
if (!empty($_GET['code']))
{
}
else
{
}
?>' | sudo tee -a /var/www/html/index.php
But that's stripping out the single quotes from around the code
... I've tried all sorts such as double quotes and escaping the single quotes.
I'm sure this is simple! Help! :)