This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## problem 1 | |
<?php | |
mysql_connect('localhost', 'root', ''); | |
mysql_select_db('mycorp'); | |
$id = $_GET['id']; | |
$query = "SELECT subject, body FROM newsletters WHERE id=". $id; | |
$response = mysql_query($query); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [[1,2,[3]],4] | |
var arr = arrayFlatten([[1,2,[3]],4,[1,[2,[3]]]]); | |
console.log(arr); | |
//Main function | |
function arrayFlatten(obj){ | |
var flattenArray=[]; | |
//Call recursive funcion sending the array as "reference" | |
flatten(obj,flattenArray); |