Skip to main content

Some Source code used often.

Mobile-Detect. Use simple code below:
  include 'Mobile_Detect.php';
  $detect = new Mobile_Detect();

  // Check for any mobile device.
  if ($detect->isMobile())
     // mobile content
  else
     // other content for desktops
Source code download here: Mobile Detect
In Javascript, there are many script or lib to do this. Here one of mine:
@extends('layouts.main')

@section('head')

@stop
@section('content')




Facebook or Youtube login
【Sample CHECK!】
Some msg
3-12-12 笹川記念会館
Copyright ©C Official Web All rights reserved.
@stop @section('script') @stop
My script above is one of my index page. It write in Laravel blade template. The JS check android and iOS version. It also check IE, if true raise alert not supported.

mysql (or may be whole SQL) RIGHT:

$age = '(YEAR(date) - ' . date('Y', $birthday) . ') - (RIGHT(date, 5) < "' . date('m-d', $birthday) . '")';

SQL get 1st n last day of the month:
echo date("Y-n-j", strtotime("first day of previous month"));
echo date("Y-n-j", strtotime("last day of previous month"));
at March 3 returns
2014-10-1
2014-10-31

Comments

Post a Comment