NYCPHP Meetup

NYPHP.org

[nycphp-talk] Fw: I need my PHP script to call a TCL proc

Tracy tech_learner at yahoo.com
Mon Jan 27 02:05:31 EST 2003


No reply to tis mail and my mail too....
If u can call a tcl prog from a phpscript, can u also call c programs?
like i already posted, does any one know how to go about cgi programming in php? i dont have enough time to go thru the entire process of installing perl, conf apache, learning to prog in perl n then the cgi ....
any answers out there?
Tracy
 Phil Powell <soazine at erols.com> wrote:
----- Original Message -----
From: 

To: 
Sent: Tuesday, January 21, 2003 5:36 PM
Subject: I need my PHP script to call a TCL proc


> From: soazine at erols.com (Phil Powell)
> Newsgroups: comp.lang.tcl,comp.lang.php
> Subject: I need my PHP script to call a TCL proc
> NNTP-Posting-Host: 65.201.150.91
> Message-ID: <1cdca2a7.0301211436.3950d68a at posting.google.com>
>
> It's either that my PHP script call a working TCL proc that converts
> all string text that looks like a URL ("http://...") into a hyperlink,
> or does someone have a PHP equivalent to do it? My PHP function
> VALIDATE_URL fails to do any conversion in its regexp, however, the
> TCL proc works every time, and the matching pattern is nearly
> identical in both!
>
> TCL:
>
> proc VALIDATE_URL {contents} {
> regsub -all "\\\
" $contents "
" contents
> regsub -all {\\.{2,}} $contents {. .} contents
> regsub -all
{(http://([a-zA-Z0-9_\\-]+\\.)+(/[a-zA-Z0-9_\\-\\.\\~\\^,%\\+]+)*[^<\\(\\)>
> ]+)} $contents "> style='text-decoration:none'>\\\\1" contents
> regsub -all {\\. \\.} $contents {..} contents
> return $contents
> }
>
> PHP:
>
> function VALIDATE_URL($contents) {
> $contents = preg_replace("/\\\
/e", '
', $contents);
> $contents = preg_replace('/\\.{2,}/e', '. .', $contents);
> $contents =
preg_replace('/http[s]?:\\/\\/\\([a-zA-Z0-9_\\-]+\\.\\)+\\(\\/[a-zA-Z0-9_\\-\\.\\~\\^,%\\
+]+\\)*[^<\\\\(\\\\)>
> ]+\\)/ei', "\\\\\\\\1", $contents);
> return preg_replace('/\\. \\./e', '..', $contents);
> }
>
> So who wins, TCL or PHP?
>
> Thanx
> Phil



--- Unsubscribe at http://nyphp.org/list/ ---



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coming together is a beginning... 
   keeping together is progress... 
      working together is success !!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030126/7ea707d2/attachment.html>


More information about the talk mailing list