<?php
//a new array in php uses ( and )
$dancerArr=Array("esmerelda","chianna","cream");
echo count($dancerArr);
echo implode(",",$dancerArr);
?>
<script>
/*
if it were created in javascript, it would be created with [ and ]
and there is no array or Array used to define the array itself
var dancerArr=["esmerelda","chianna,","cream"];
and if a single number is used in the [ ] as
var dancerArr=[3];
that creates a 3 node array, not a single node with the number 3 or string '3' in node 0.
*/
var dancerArrStr="<?php echo implode(",",$dancerArr);?>";
var dancerArr=dancerArrStr.split(",");
alert(dancerArrStr);
alert(dancerArr[1]);
</script>
array syntax or grammar in javascript vs php
notes and quirk solutions found over time
-
- Site Admin
- Posts: 254
- Joined: Tue Oct 27, 2009 9:33 pm
Jump to
- Software and hardware tips
- ↳ 3D
- ↳ actionscript2 as2
- ↳ Actionscript 3 as3
- ↳ after effects
- ↳ android
- ↳ Apple osX support
- ↳ CPP C++ Setup, Programming, and Quirks
- ↳ CSS
- ↳ digital phone systems
- ↳ drupal
- ↳ Fallout 4 Mods
- ↳ game tips and tech
- ↳ HDV video
- ↳ HTML5
- ↳ Infected Software
- ↳ javascript
- ↳ Java programming
- ↳ laptop repair
- ↳ MySQL
- ↳ osx86 fun
- ↳ php scripting and programming
- ↳ Regular Expressions In Varying Programs
- ↳ ruby | ruby on rails | win7
- ↳ Shared Server Help
- ↳ Virus removal
- ↳ Virtual Machines
- ↳ Virtual Reality VR
- ↳ vista support
- ↳ Visual Studio 2015
- ↳ vpn
- ↳ web plugins addons
- ↳ win xp
- ↳ windows 7 support
- ↳ windows 8 support
- ↳ windows 10 support
- ↳ wordpress
- ↳ XBOX One X
- ↳ Windows 11 support
- online website reviews
- ↳ not refurbished but broken products
- internet crime evidence
- ↳ phony websites with fake credentials selling items
- writing
- ↳ science fiction
- Debunking Myths
- Film TV and Media Reviews
- ↳ Film Reviews