[jQuery] Off topic: which programming language forwebdevelopment
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=843011004-23112006><FONT face=Calibri
color=#0000ff>Yes, PHP have the same functionallity:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843011004-23112006><FONT face=Calibri
color=#0000ff>$var = "array.txt";</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843011004-23112006><FONT face=Calibri
color=#0000ff>$explode = (".", $var);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843011004-23112006><FONT face=Calibri
color=#0000ff>list($name,$ext) = $explode;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843011004-23112006><FONT face=Calibri
color=#0000ff>Then </FONT></SPAN></DIV>
<DIV><SPAN class=843011004-23112006><FONT face=Calibri color=#0000ff>$name =
array</FONT></SPAN></DIV>
<DIV><SPAN class=843011004-23112006><FONT face=Calibri color=#0000ff>$ext =
txt</FONT></SPAN></DIV>
<DIV><SPAN class=843011004-23112006></SPAN><SPAN lang=es><FONT face=Arial
size=2>--</FONT></SPAN> <BR><SPAN lang=es><B><FONT face=Calibri
size=2>ReynierPM</FONT></B></SPAN> <BR><SPAN lang=es><FONT face=Calibri
size=2>5to Ing. Informática</FONT><B></B></SPAN> <BR><SPAN lang=es><FONT
face=Calibri size=2>Maestro de poco, aprendiz de mucho</FONT><B></B></SPAN>
</DIV>
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=es dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>De:</B> discuss-bounces@jquery.com
[mailto:discuss-bounces@jquery.com] <B>En nombre de </B>Yehuda
Katz<BR><B>Enviado el:</B> miércoles, 22 de noviembre de 2006 8:50
pm<BR><B>Para:</B> jQuery Discussion.<BR><B>Asunto:</B> Re: [jQuery] Off topic:
which programming language forwebdevelopment<BR></FONT><BR></DIV>
<DIV></DIV>Easily with Ruby. "a,b,c,d|d,e,f,g*h,i,j,k|l,m,n,o".split("*")
returns an array of the two strings, which can then be further processed. I
believe that PHP has similar functionality.<BR><BR>-- Yehuda<BR><BR>
<DIV><SPAN class=gmail_quote>On 11/22/06, <B class=gmail_sendername>Christopher
Jordan</B> <<A href="mailto:cjordan@placs.net">cjordan@placs.net</A>>
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV text="#000000" bgcolor="#ffffff"><BR>
<BLOCKQUOTE cite=http://mid200611222025.52194.larry@garfieldtech.com
type="cite"><SPAN class=q>
<BLOCKQUOTE type="cite"><PRE>I agree that it's a matter of opinion. But I've gotta say that I *LOVE*<BR>being able to treat *any* arbitrary string of text as a list (read:<BR>array). Let me give you an example:<BR><BR><cfset TheList = ListRest(
CGI.HTTP_REFERRER,"?")><BR><cfloop index="i" from="1" to="#ListLen(TheList,"&")#"><BR> <cfset ThisItem = ListGetAt(TheList,i,"&")><BR>
<cfif ListFirst(ThisItem,"=") EQ "numPageID"><BR> <cfset MyNumPageID = ListLast(ThisItem,"=")><BR> </cfif><BR> </cfloop><BR><BR>This code allows me to treat one string of characters (the http_referrer
<BR>in this case) as three different arrays. I didn't have to create an<BR>array out of any of it. The very powerful "List" functions allow me to<BR>accomplish this, and CF handles the conversion to arrays eternally. This
<BR>is *not* to say that I can't create and manipulate arrays directly, and<BR>that I *have to* use lists instead of arrays, that's just not true. I<BR>can use the ArrayNew() or StructNew() functions to create arrays and<BR>
structures that I can easily reference and manipulate.<BR> </PRE></BLOCKQUOTE><PRE>Er, you are aware that you can reference strings as arrays in PHP, or if <BR>needed convert a string to a real array in one line, right?<BR><BR>for ($i=0; $i < strlen($string); ++$i) {<BR> print $string[$i] . "\n";
<BR>}<BR>foreach (explode($string) as $char) {<BR> print $char . "\n";<BR>}<BR><BR> </PRE></SPAN></BLOCKQUOTE>How
do you tell PHP what the list delimiter is? In ColdFusion I can take a list
like this:<BR><BR><cfset str =
"a,b,c,d|d,e,f,g*h,i,j,k|l,m,n,o"><BR><BR>I can then turn around and get
the first element based on the asterisk being the delimiter and then treat the
result (a,b,c,d|d,e,f,g) as a new list who's delimiter is the pipe and then
end up with last list whose delimiter is the comma.<BR><BR><cfloop
index="i" from ="1" to="#ListLen(str, '*')#"><BR>
<cfset str2 = ListGetAt(str, i, "*")><BR> <cfloop
index="n" from="1" to="#ListLen(str2, '|')#"><BR>
<cfset str3 = ListGetAt(str2, n,
"*")><BR> <cfloop index="j"
from="1" to="#ListLen(str3)#"><BR>
<!--- do some stuff with the
innermost elements of the list ---><BR>
</cfloop><BR>
</cfloop><BR></cfloop><BR><BR>Can you do that in
php?<BR><BR>Cheers,<BR>Chris<BR></DIV><BR>_______________________________________________<BR>jQuery
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:discuss@jquery.com">discuss@jquery.com</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://jquery.com/discuss/"
target=_blank>http://jquery.com/discuss/</A><BR><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>Yehuda Katz<BR>Web Developer | Wycats
Designs<BR>(ph) 718.877.1325 </BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/