note 73947 added to function.imap-open
| From: | dsthomas at gmail dot com | Date: | Fri, 16 Mar 2007 23:10:59 +0000 |
| Subject: | note 73947 added to function.imap-open | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124527@lists.php.net to get a copy of this message | ||
In reference to not being able to use $var in the server string:
Because of the way the complex string expansion works, you would have to use a pair of { at the
beginning (and if you were doing this for another reason, e.g. an echo, a pair of } at the end).
It's the combination of the { and the $ in the beginning that is causing PHP 4 & 5 to
"eat" the first {. Also, do not forget to end the expansion point with } after the
variable name.
<?php
$svr = 'mail.myserver.com';
$rs = imap_open("{{$svr}:143}INBOX", 'user_id', 'password');
?>
References:
See the complex string expansion section on http://www.php.net/manual/en/language.types.string.php
----
Server IP: 216.194.113.175
Probable Submitter: 69.148.169.88
----
Manual Page -- http://www.php.net/manual/en/function.imap-open.php
Edit -- https://master.php.net/note/edit/73947
Del: integrated -- https://master.php.net/note/delete/73947/integrated
Del: useless -- https://master.php.net/note/delete/73947/useless
Del: bad code -- https://master.php.net/note/delete/73947/bad+code
Del: spam -- https://master.php.net/note/delete/73947/spam
Del: non-english -- https://master.php.net/note/delete/73947/non-english
Del: in docs -- https://master.php.net/note/delete/73947/in+docs
Del: other reasons-- https://master.php.net/note/delete/73947
Reject -- https://master.php.net/note/reject/73947
Search -- https://master.php.net/manage/user-notes.php