PHP | Sorting Complex Multidimensional Array

| By Webner

Suppose we have a complex array like below: $products = array( array( ‘product’ => array(‘id’ => 1, ‘name’ => ‘Jquery tutorial book’), ‘product_details’ => array(‘cost’ => 10, ‘edition’ => ‘first’) ), array( ‘product’ => array(‘id’ => 2, ‘name’ => ‘javascript

Toggling a checkbox on/off through Selenium webdriver

| By Webner

Below is the script for on/off the checkbox using webdriver: package mypackage; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class myclass { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); String baseUrl = “http://www.facebook.com”; driver.get(baseUrl);

How to create a dynamic div using Javascript

| By Webner

Here is sample code if you want to create a dynamic div using Javascript: <script type=”text/javascript”> divCount =0; function createDiv() { var divTag = document.createElement(“div”); var studList =””; studList += ‘<select id=”BOX_’+divCount+'” name=”BOX_’+divCount+'”>’; studList += ‘<option value=””>— Select —</option>’; for(i=0;i<countStud;i++)