What do you want to save?
Add Code snippet
New code examples
-
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 -
C 2021-11-05 08:28:19
how to delete data and add from file in c language
#include <stdio.h> #include <stdlib.h> void Menu(); void New_Staff(); void Delete_Staff(); void Export_Profile(); struct element{ char id[20]; char name[20]; char gender[20]; char phone[20]; char email[20]; }profile; int... Add solution -
C 2021-11-01 23:31:06
c how to encrypt and decrypt
#include <stdio.h> #include <stdlib.h> #include <string.h> #define N 100 int main() { int switcho; do { printf("Criptare random: 1\nCriptare avendo valore: 2\nDecriptare: 3\nSalvati: 4\n\nScegliere: "); scanf("%d&q... Add solution -
PHP 2021-10-28 07:11:07
csv to array php
<?php $row = 1; if (($handle = fopen("test.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== ... Add solution -
C 2021-10-25 03:17:10
how to create a file in c
/** * C program to create a file and write data into file. */ #include <stdio.h> #include <stdlib.h> #define DATA_SIZE 1000 int main() { /* Variable to store user content */ char data[DATA_SIZE]; /* File pointer to hold refer... Add solution