Home  >  Article  >  php教程  >  用Socket发送电子邮件五

用Socket发送电子邮件五

WBOY
WBOYOriginal
2016-06-13 10:27:521293browse

显示调试信息
1 function show_debug($message, $inout)
2 {
3 if ($this-$#@62;debug)
4 {
5 if($inout=="in") //响应信息
6 {
7 $m="$#@60;$#@60;,;
8 }
9 else
10 $m="$#@62;$#@62; ,;
11 if(!ereg(" $", $message))
12 $message .= "$#@60;br$#@62;";
13 $message=nl2br($message);
14 echo "$#@60;font color=#999999$#@62;${m}${message}$#@60;/font$#@62;";
15 }
16 }
  这个函数用来显示调试信息。可以在$inout中指定是上传的指令还是返回的响应,如果为上传指令,则使用"out";如果为返回的响应则使用"in"。
第3行,判断是否要输出调试信息。
第5行,判断是否为响应信息,如果是,则在第7行将信息的前面加上"$#@60;$#@60; "来区别信息;否则在第10行加上 "$#@62;$#@62; "来区别上传指令。
第11-12行,判断信息串最后是否为换行符,如不是则加上HTML换行标记。第13行将所以的换行符转成HTML的换行标记。
第14行,输出整条信息,同时将信息颜色置为灰色以示区别。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn