Skip to content

Instantly share code, notes, and snippets.

View anxp's full-sized avatar

Andrii anxp

View GitHub Profile
@justinwalsh
justinwalsh / rekey_multi_array.php
Created November 4, 2011 17:28
PHP function to rekey or index a multidimensional array and preserve associative keys
<?php
function rekey_multi_array($array) {
$new = array();
$count = 0;
if (is_array($array)) {
foreach ($array as $key => $val) {
if (!is_numeric($key)) {
$new[$key] = $this -> rekey_multi_array($val);
} else {
$new[$count] = $this -> rekey_multi_array($val);
@aczietlow
aczietlow / selenium-php-webdriver-cheatsheet.md
Last active September 12, 2024 04:08 — forked from huangzhichong/selenium-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    

$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);