note 73947 deleted from function.imap-open by didou

From: Date: Sat, 29 Dec 2007 21:00:30 +0000
Subject: note 73947 deleted from function.imap-open by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134222@lists.php.net to get a copy of this message
Note Submitter: dsthomas at gmail dot com ---- 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

« previous php.notes (#134222) next »