Let us consider we get a value from a post actionone,two,three
i.e: $ss = $_POST['arv'];
Now using the php method explode() we will convert the string in to a array object
explode(seperator,string);
i.e. $tok = explode(‘,’,$ss);
so we have got a string array. Now we print the array using print_r() method. This method prints the array in string [...]
Posts Tagged ‘php’
How can I split the string using php?
Posted in javascript, tagged php, split, string on June 17, 2008 | 5 Comments »
How to carry an array value from javascript to php?
Posted in javascript, tagged array, javascript, php, submit on June 17, 2008 | Leave a Comment »
The javascript array values can be passed to a php file using the following method
Step 1:
Let us consider we have a js array as
<script language=javascript>
scriptAr = new Array();
scriptAr[0] = “one”;
scriptAr[1] = “two”;
scriptAr[2] = “three”;
<script>
scriptAr = new Array();
scriptAr[0] = “one”;
scriptAr[1] = “two”;
scriptAr[2] = “three”;
Step 2:
Now we will create a hidden form field as follows
<form action=”phpArrayTest.php” [...]