What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-11-10 21:42:15
csv to json php
<?php //Open our CSV file using the fopen function. $fh = fopen("names.csv", "r"); //Setup a PHP array to hold our CSV rows. $csvData = array(); //Loop through the rows in our CSV file and add them to //the PHP ... Add solution -
C 2021-11-10 13:27:16
c read word from file
#include <stdio.h> #include <stdlib.h> int main(int argc, char * argv[]) { // This program reads a file from its arguments and prints a word by word. Additionally, it counts the words in the file. if (argc < 2) return 1; char * f... Add solution -
C 2021-11-08 04:14:15
how to ascii art in c
#include <stdio.h> #define MAX_LEN 128 void print_image(FILE *fptr); int main(void) { char *filename = "image.txt"; FILE *fptr = NULL; if((fptr = ... Add solution -
PHP 2021-11-07 12:52:12
appending txt file from php
// LOCK_EX will prevent anyone else writing to the file at the same time // PHP_EOL will add linebreak after each line $txt = "data-to-add"; $myfile = file_put_contents('logs.txt', $txt.PHP_EOL , FILE_APPEND | LOCK_EX); // Second option is this... Add solution -
C++ 2021-11-06 21:06:11
how to choose struct's endianness cpp
#include <stdio.h> #include <stdint.h> //The line bellow does the trick: //__attribute__((packed, scalar_storage_order("big-endian"))) struct __attribute__((packed, scalar_storage_order("big-endian"))) mystruct { uint1... Add solution -
PHP 2021-11-06 13:28:10
php read csv file line by line
<?php $row = 1; if (($handle = fopen("test.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== ... Add solution -
PHP 2021-11-05 21:44:14
php save image from url to folder
You should be able to use file_get_contents for this one. In order to use an URL with file_get_contents make sure allow_url_fopen is enabled in you php.ini file. define('DIRECTORY', '/home/user/uploads'); $content = file_get_contents('http://anothersite... Add solution