Echoing form actions


I have a question is there a simple way of echoing the below statment with php rather then using HTML and echoing PHP within.

<form action=“<?= $_SERVER[‘PHP_SELF’] ?>” method=“POST”>

If you don’t specify the action it will post to the same page, which is the same as specifying $_SERVER[‘PHP_SELF’], so you might just as well use

<form action=“” method=“post”>

without the need for PHP.

echo "<form action=\\"{$_SERVER['PHP_SELF']}\\" method=\\"POST\\">";

Thanks for the answer please could someone tell me the theory why we need to use the { } around $_SERVER[‘PHP_SELF’]