Skip to content

Instantly share code, notes, and snippets.

View globalideias's full-sized avatar

Marcos Paulo F Guedes globalideias

View GitHub Profile
<?php
$qtd_numeros = 6;
$min = 1;
$max = 6;
$numeros = array();
for($i = 0; $i < $qtd_numeros; $i++){
<?php
$a = "aa";
$b = "bb";
$c = "cc";
$d = "dd";
$e = "ee";
$get = 'a';
<?php
$start = '2016-06-08 12:01:00';
$end = '2016-06-08 13:15:00';
$minutos = round(abs((strtotime($end) - strtotime($start))/60));
echo $minutos;
<?php
/*$labels = [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"];*/
@globalideias
globalideias / php
Created April 22, 2017 13:46
unidades_x_minutos
<?php
const MINUTOS_UNIDADE = 20;
$total_unidades = 23;
$tempo_total = $total_unidades * MINUTOS_UNIDADE;
$horas = (int)($tempo_total / 60);
$minutos = $tempo_total % 60;
@globalideias
globalideias / soma_dados_array_horizontal_vertical
Last active June 24, 2017 01:14
Soma dados de um array vertical e horizontal
<?php
$servs['SERVICO1'][1] = 10;
$servs['SERVICO1'][2] = 30;
$servs['SERVICO1'][3] = 1;
$servs['SERVICO2'][1] = 20;
$servs['SERVICO2'][2] = 40;
$servs['SERVICO2'][3] = 2;
$servs['SERVICO3'][1] = 100;
<?php
$hoje = date("Y-m-d");
$inicio_turno_manha = "08:00";
$fim_turno_manha = "12:00";
$time_inicio_turno_manha = strtotime($hoje . $inicio_turno_manha);
$time_fim_turno_manha = strtotime($hoje . $fim_turno_manha);
function remove_accents($string) {
if (!preg_match('/[\x80-\xff]/', $string))
return $string;
$chars = array(
// Decompositions for Latin-1 Supplement
chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',
chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',
chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',
chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',

Cab Teste

Este um teste de compartilhamento de informações.