Skip to content

Instantly share code, notes, and snippets.

@whoisryosuke
whoisryosuke / laravel-loop-through-old-flash.php
Created May 16, 2018 23:58
Laravel - Get old form input values for array-based input
<?php
@if(old('uid_tag'))
@foreach(old('uid_tag') as $product)
<input type="text" name="uid_tag[]" value="{{ old('uid_tag')[$loop->index] }}" size="30" />
<textarea
placeholder="Include weight or count"
name="product_description[]"
cols="45"
rows="1"
value="{{ old('product_description')[$loop->index] }}"
@sobstel
sobstel / datetime_timezones.php
Created September 9, 2011 16:52
PHP: Converting DateTime between timezones
<?php
// now
$date = date_create('2010-12-31 22:00:01', timezone_open('Europe/Amsterdam'));
// Buenos Aires
date_timezone_set($date, timezone_open('America/Argentina/Buenos_Aires'));
echo $date->format('Y-m-d H:i:s');
// 2010-12-31 18:00:01
// UTC