Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| $con = mysqli_connect("localhost","my_user","my_password","my_db"); | |
| $query = "select * from user table"; | |
| $result = mysqli_query($con,$query); | |
| $array_key = ((array) $result[0]); | |
| $headers = (object) array_keys($array_key); | |
| $delimiter = ","; | |
| $filename = 'process.csv'; | |
| $f = fopen('php://memory', 'w'); | |
| fputcsv($f, (array)$headers, $delimiter); | |
| foreach ($result as $line) { |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| //Parse the GA Cookie | |
| function gaParseCookie() { | |
| if (isset($_COOKIE['_ga'])) { | |
| list($version, $domainDepth, $cid1, $cid2) = explode('.', $_COOKIE["_ga"], 4); | |
| $contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1 . '.' . $cid2); | |
| $cid = $contents['cid']; | |
| } else { | |
| $cid = gaGenerateUUID(); | |
| } | |
| return $cid; |