php - how to echo $_SERVER['PHP_SELF'] within a string -
i can't figure out syntax quotes within quotes within quotes.? (edit: not matter of this, had echo should concatenated. see answer below corrected code)
this code brings syntax error
$stringdata="<?echo'<form method=\"post\" action=\"<? echo$_server['php_self'];?>\"><button type=\"submit\">';?>";
i've tried many combinations of quotes , backslashes.
what proper syntax?
bad grammar. should work ;)
if want echo it:
echo '<form method="post" action="'.$_server['php_self'].'"><button type="submit">';
if want keep on variable:
$string = '<form method="post" action="'.$_server['php_self'].'"><button type="submit">';
Comments
Post a Comment