<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I’m catching up on unread items and I just saw this – you can simplify this script<BR><DIV><DIV>On 16 Aug 2007, at 07:15, Fred B wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Here the script:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro">✂------✂------✂------✂------✂------✂------✂------✂------✂------✂------</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro">#!/usr/bin/php -q</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Hiragino Kaku Gothic Pro; min-height: 18.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro"><?php</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro"><SPAN class="Apple-converted-space">    </SPAN>include_once "/path/to/markdown-extra.php";</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Hiragino Kaku Gothic Pro; min-height: 18.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro"><SPAN class="Apple-converted-space">       </SPAN>while (!feof(STDIN)) {</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro"><SPAN class="Apple-converted-space">           </SPAN>$my_text .= fread(STDIN, 4096);</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro"><SPAN class="Apple-converted-space">       </SPAN>}</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Hiragino Kaku Gothic Pro; min-height: 18.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro"><SPAN class="Apple-converted-space">    </SPAN>$my_html = Markdown($my_text);</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Hiragino Kaku Gothic Pro; min-height: 18.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro"><SPAN class="Apple-converted-space">    </SPAN>echo $my_html;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro">?></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Hiragino Kaku Gothic Pro" size="3" style="font: 12.0px Hiragino Kaku Gothic Pro">✂------✂------✂------✂------✂------✂------✂------✂------✂------✂------</FONT></P> </BLOCKQUOTE></DIV><BR></DIV><DIV>to just</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><?php</DIV><DIV>include_once "/path/to/markdown-extra.php";</DIV><DIV>echo Markdown(file_get_contents('php://stdin'));</DIV><DIV>?></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>which perhaps will be marginally faster.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Ciarán</DIV></BODY></HTML>