What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-09-03 23:25:03
laravel collection group
$collection = collect([ ['account_id' => 'account-x10', 'product' => 'Chair'], ['account_id' => 'account-x10', 'product' => 'Bookcase'], ['account_id' => 'account-x11', 'product' => 'Desk'], ]); $grouped = $collection->gr... Add solution -
TypeScript 2021-09-03 08:53:03
express validator
// this method create custom express validator using middleware const { validationResult, check } = require('express-validator') exports.resultsValidator = (req) => { const messages = [] if (!validationResult(req).isEmpty()) { const errors = ... Add solution -
Other 2021-09-01 07:50:01
display sequence of days
function weekendDaysToString($days, $lang = 'en') { $and = array('pt'=>'e', 'en'=>'and'); $strWeek = array( // config with more langs! 'pt'=>array("Segunda", "Terça", "Quarta", "Quinta... Add solution -
PHP 2021-08-31 21:05:02
php multibyte string shuffle
php > $string = "Pretend I'm multibyte!"; php > $len = mb_strlen($string); php > $sploded = array(); php > while($len-- > 0) { $sploded[] = mb_substr($string, $len, 1); } php > shuffle($sploded); php > echo join('', $splode... Add solution