Printable View
:D[email protected]
So here we go again! PHP, one of the strongest languages in the whole web design world! If you know how to use it you have the power. Here we have PHP codes and scripts where you can easily use it on your websites! So enjoy, you'll love this open source codes that we have different codes in different categories such as Forums, Forms, Emailing, PHP generators!
Java script array basic code
<html>
<body>
<script type="text/javascript">
var parents = ["Jani", "Tove"];
var children = ["Cecilie", "Lone"];
var family = parents.concat(children);
document.write(family);
</script>
</body>
</html>
Add new elements to the beginning of an array - unshift()
<html>
<body>
<script type="text/javascript">
var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.unshift("Kiwi") + "<br />");
document.write(fruits.unshift("Lemon","Pineapple") + "<br />");
document.write(fruits);
</script>
<p><b>Note:</b> The unshift() method does not work properly in Internet Explorer, it only returns undefined!</p>
</body>
</html>
Add an element to position 2 in an array - splice()
<html>
<body>
<script type="text/javascript">
var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write("Removed: " + fruits.splice(2,0,"Lemon") + "<br />");
document.write(fruits);
</script>
</body>
</html>
thanks....
good creative information