What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-28 01:45:09
how to selectively rearrange words in array in c
#include <stdio.h> #include <string.h> void main() { char str[100],ch; int i,j,l; printf("\n\nSort a string array in ascending order :\n"); printf("--------------------------------------------\n"); ... Add solution -
PHP 2021-10-24 02:42:08
php convert mb to bytes
function toByteSize($p_sFormatted) { $aUnits = array('B'=>0, 'KB'=>1, 'MB'=>2, 'GB'=>3, 'TB'=>4, 'PB'=>5, 'EB'=>6, 'ZB'=>7, 'YB'=>8); $sUnit = strtoupper(trim(substr($p_sFormatted, -2))); if (intval($sUnit) !== 0) { ... Add solution -
PHP 2021-10-23 17:52:15
php remove blank values from array
<?php $arr = array('1', '', '2', '3', '0'); // Incorrect: print_r(array_filter($arr)); // Correct: print_r(array_filter($arr, 'strlen')); //Custom print_r(array_filter($arr, function ($val) {if ($val > 0) {return true;} else {return false;}})); Add solution