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

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -