Wednesday 13 May 2015

Deprecated: Function split() is deprecated


Code:
  
  $name = "abc,def,ghi,jkl";

  $nameArray = split("\,", $name);
  
  echo count($nameArray);
  
  for($i=0;$i";
  }
  $name = "abc,def,ghi,jkl";

  $nameArray = preg_split("/,/", $name);//  split to preg_split and \, to changed /,/
  
  echo count($nameArray);
  
  for($i=0;$i";
  }
Solved:
  
   $name = "abc,def,ghi,jkl";

  $nameArray = preg_split("/,/", $name);//  split to preg_split and \, to changed /,/
  
  echo count($nameArray);
  
  for($i=0;$i";
  }

Thursday 7 May 2015

how to get radio button value in jquery?

<html>
      <body>

                <input type="radio" name="abc" value="1">A
                <input type="radio" name="abc" value="2">B
                <input type="radio" name="abc" value="3">C
                <input type="radio" name="abc" value="4">D
                <input type="radio" name="abc" value="5">E         

                <button id="submit">submit</button>


               <script>
                          $(function(){
                                $("#submit").click(function(){      
                                        alert($('input[name=q12_3]:checked').val());
                                });
                          }); 

               </script>

      </body>
</html>