note 99776 modified in reserved.variables.globals by danbrown
| From: | danbrown@php.net | Date: | Mon, 06 Sep 2010 15:13:02 +0000 |
| Subject: | note 99776 modified in reserved.variables.globals by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172339@lists.php.net to get a copy of this message | ||
If you want to email yourself a copy of the GLOBALS (like I just had to in an AJAX call, in order to
see why a particular variable wasn't working), you can use print_r with the 2nd parameter so it
returns the information as a string instead of outputting it.
<?php
@mail('you@example.com', 'Email Subject', "Email content : GLOBALS
info\n". print_r($GLOBALS,true), "From: you@example.com");
?>
Note that the print_r($GLOBALS,true) part is the important bit.
--was--
If you want to email yourself a copy of the GLOBALS (like I just had to in an AJAX call, in order to
see why a particular variable wasn't working), you can use print_r with the 2nd parameter so it
returns the information as a string instead of outputting it.
<?php
@mail('your@emailaddress.com', 'Email Subject', "Email content : GLOBALS
info\n". print_r($GLOBALS,true), "From: your@emailaddress.com");
?>
Note that the print_r($GLOBALS,true) part is the important bit.
http://php.net/manual/en/reserved.variables.globals.php