1. Delimiter Tools
https://delim.co/#
2. Convert CSV columns to SQL QUERIES
https://sqlizer.io/#/result/M9mdPpyv-0hwMfY4mkcfKhzAwy7OLbTbbrUu7Yo4_j11zN0eHdM0oeIN02K_6jrmdjTfK27LPqyjiWBhnKhcJA==
Thursday, 10 October 2019
Wednesday, 19 June 2019
Tuesday, 18 June 2019
Friday, 24 May 2019
Monday, 29 April 2019
Wednesday, 17 April 2019
Passing php array into javascript variable
source :<?php // php array $fruits = array('apple', 'orange', 'mango', 'banana', 'strawberry'); ?>
<script type="text/javascript"> // use php implode function to build string for JavaScript array literal var fruits = <?php echo '["' . implode('", "', $fruits) . '"]' ?>; // ["apple", "orange", "mango", "banana", "strawberry"] </script>
https://www.dyn-web.com/tutorials/php-js/array.php
Tuesday, 16 April 2019
regex tester
script :
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchvar paragraph = '222323';var regex = '[0-9]{3,}'; //with at least 3 and above digitsvar found = paragraph.match(regex);console.log(found);//which return back the array of numbers
Postcode validation
https://stackoverflow.com/questions/17920096/php-validation-1st-line-of-address-and-postcode
Thursday, 4 April 2019
Tuesday, 26 February 2019
Tuesday, 19 February 2019
Array Sorting based on key
foreach ($data as $key => $row) {
$distance[$key] = $row['distance'];
}
array_multisort($distance, SORT_ASC, $data);
code to enable sorting for json feed/array.source :
https://stackoverflow.com/questions/5305594/sort-a-multidimensional-array-using-array-multisort/5305641#5305641
Tuesday, 22 January 2019
Regex Pattern With PHP
REGEX PATTERN
Match using Class
Match using Class
<?php $registerpattern = '/<a(.*)class="register"((?:.)*)>/'; ?>
Match the Whole word<?php $loginpattern = '/\bpathtologin\b/'; ?>
Monday, 7 January 2019
Date Format Compatiblity Cross Browser
Solution 1
Using a format date from momment js (plugin)
moment().format('MMMM Do YYYY, h:mm:ss a'); // January 7th 2019, 2:48:53 pm
moment().format('dddd'); // Monday
moment().format("MMM Do YY"); // Jan 7th 19
moment().format('YYYY [escaped] YYYY'); // 2019 escaped 2019
moment().format(); // 2019-01-07T14:48:53+08:00
The Solution
The problem lies in the format that you pass the required date to the Date() object. For some reason, and don’t ask me why, the two aforementioned browsers surprisingly do not support the date format “yyyy-mm-dd” and therefore fail. I haven’t managed to compile a definitive list of supported date formats, however I can tell you the following formats are definitely supported across all browsers and would advise sticking to one of these to avoid errors:
- var d = new Date(2011, 01, 07); // yyyy, mm-1, dd
- var d = new Date(2011, 01, 07, 11, 05, 00); // yyyy, mm-1, dd, hh, mm, ss
- var d = new Date("02/07/2011"); // "mm/dd/yyyy"
- var d = new Date("02/07/2011 11:05:00"); // "mm/dd/yyyy hh:mm:ss"
- var d = new Date(1297076700000); // milliseconds
- var d = new Date("Mon Feb 07 2011 11:05:00 GMT"); // ""Day Mon dd yyyy hh:mm:ss GMT/UTC
http://biostall.com/javascript-new-date-returning-nan-in-ie-or-invalid-date-in-safari/
https://momentjs.com/