I do know both and I don't find one to be any harder or easier than the other. They're both more or less the same (PHP was based almost exclusively on Perl, you know).i dont know php i know perl better than php
How is it less confusing than Perl? People are always making blanket statements about PHP ("it's less confusing", "it's less complicated", "it's easier to learn", "it's faster to write", etc...) without ever backing them up with any reasons. Here's the same script in Perl:Less confusing than perl.
You can't just change \n to <br>, suppose we're not running this from the web? You'd get some messy output, "Hello World!<br>Hello World!<br>Hello World!<br>Hello World!<br>......"echo "$myvar<br>";
My theory is that PHP is the new "in-language" and people just feel compelled to praise it.I have always wondered why people say that stuff about php/perl... when it look very similar to me.
I don't know all these languages, so some of these are just educated guesses:So what does this look like in ASP?, C/C++?, Python?, Javascript?, Qbasic? Can it be done in coldfusion?
myvar="Hello World!"
For i=1 to 10 step 1
response.write myvar & "\n"
Next
string myvar="Hello World!";
for(i=1; i<10; i++){
cout << myvar << endl;
}
myvar="Hello World!"
for i in range(9):
print myvar,"\n"
var myvar="Hello World!";
for (i=1; i<10; i++){
document.writeln(myvar);
}
dim myvar$ as string
myvar$="Hello World!"
for i = 1 to 10
print myvar$
next i
<cfset myvar="Hello World!">
<cfloop index="i" from="1" to="10">
<cdoutput>
#myvar#
</cfoutput>
</cfloop>
Oops, that should of course be <cfoutput>.<cdoutput>