spc-engineers
New Member
- Messages
- 9
- Reaction score
- 0
- Points
- 0
PHP, then JS. If they suppoted JSP, that would be top.
PHP and JS both have their own specific attributes that are catered to their 'audience'.Javascript - Easy To Use - Less Powerful And Less Functional.
PHP - Difficult To Use- More Powerful And More Functional
$x=145;
$str="A string...";
function stuff($a,$b) {
echo "Concatenate \"$a\" and \"$b\"<br>";
return $a.$b;
}
$str=stuff($str,$x);
$list=array(5,4,"Bob",$str);
print_r($list);
echo "<br>";
class Test {
var $x;
static $something="Static value"; //PHP 5 only
function __construct() {
//Initialize
}
function method() {
return sqrt($this->x);
}
}
$tim=new Test();
echo $tim->method()."<br>";
$obj=(object)array('x'=>15,'name'=>'Bob');
echo "$obj->name $obj->x <br>";
$var='name';
echo $obj->$var;
function myFunc(x,y) { blah blah blah };
//Or
var myFunc=function(x,y) { blah blah blah };
function Test() {
//Instance-level members / methods
this.x=5;
this.method=function() { return Math.sqrt(this.x); };
}
//Statics
Test.something=function() { return "Static function"; };
var tim=new Test();
tim.method();
var tim={x: 2, array: [5,2,"Bob"], method: function() { return this.array[this.x]; } };
tim.method();
//You can also access the members as an array index - tim["name"]