php string to javascript array
<?php $str="RAJEEV~@~DHAR~@~DWIVEDI"; ?>
<script>
function getarray(x){
var str="<?php echo $str ; ?> ";
var arr=str.split('~@~');
alert(arr[0]); alert(arr[1]); alert(arr[2]);
}
</script>
<input type="button" value="getarray" name="GET ARRAY" onclick="getarray();" />
It is actually a nice and helpful piece of information.
ReplyDeleteI'm satisfied that you simply shared this helpful information with us.
Please keep us up to date like this. Thank you for sharing.
Visit my homepage - SW Florida Web Design