PHP

phpコード例1
<?php
define(“STUDYPHP”,”startnews24″);
class CftConstDemo
{

PHP

1.file_get_contents
<?php
$url = “
$contents = file_get_contents($url);

//$getcontent = ic ...

OpenSource

1.mongoperf
–help, -h
Returns information on the options and use of mongoperf.

<jsonconfig> ...

IT

pipのアップグレード
sudo pip install –upgrade pip

djangoのインストール
sudo pip install Django

インストール結果を確認 ...

Software

Ubuntu

$ cat/etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DI ...

PHP

phpコード
try {
$dbh = new pdo(‘mysql:host=localhost;dbname=dbtest’, ‘root’, “); ...

PHP

phpコード:
$dsn = ‘mysql:dbname=ent;host=172.17.20.100′;
$user = ‘root’;
$password = ̵ ...

Software

参考コード:
<?php
backup_tables(‘localhost’,’startnews24user’,’startnews24pwdR ...

Python

コード下記

import os, math
from base64 import b64encode
randStr = lambda n: b64encode(os.urandom(int(math.ce ...

Software

①URL+”&”+”t=”+Math.random();

②”?timestamp=” + new Date().getTime(); ...

JavaScript

参考コード
<script src=”jquery-1.7.1.js”></script>
<script src=”jquery-1.12.4.js& ...

PHP

サンプルコード

function deldir($path)
{
if ($handle=opendir($path))
{
while (false!==($file=readdir($h ...

PHP

phpコード:
$pagesize=10;
$url=$_SERVER;
$url=parse_url($url);
$url=$url;
$numq=mysql_query(“SE ...

PHP

ignore_user_abort
クライアントの接続が切断された際にスクリプトの実行を終了するかどうかを設定する
int ignore_user_abort ( )

set_time_limit

PHP

phpコード
<?php

$logfile = “tewf_2016.log”;
$timezone = “+0100”;/* Timezone cor ...

PHP

参考コード:
function mailCheck(valpp) {
if (valpp != “” ){
if (!valpp.match(/^+@+$/)){
return ...

PHP

phpコード:
function url_Validate(p) {
var regexp =/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:+)?(\/|\/())?/
re ...

PHP

1.escape定義関数
function escape($string, $in_encoding = ‘UTF-8’,$out_encoding = ‘UCS-2’) {