Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

Printing out $GLOBALS using foreach

$
0
0

So I need to print out bunch of pre-defined globals on my page. I try using:

<?php foreach ( $GLOBALS as $key => $value ) { ?>
  <dt><label for="<?php echo $key ?>">$key</label></dt>
    <dd><input type="text" name="<?php echo $key ?>" value="<?php echo $value ?>" /></dd>
<?php } ?>

But that doesn't prints global variables, just some errors instead. How can I correctly get that list? I hope you get the idea of what I want. Thank you!


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>