PHP exif 介绍
// PHP exif
// --
// wikipedia 介绍:
// EXIF(Exchangeable image file format)是可交换图像文件的缩写,是专门为数码相机的照片设定的,可以记录数码照片的属性信息和拍摄数据。
// EXIF可以附加于JPEG、TIFF、RIFF等文件之中,为其增加有关数码相机拍摄信息的内容和索引图或图像处理软件的版本信息。
// --
// php 中 exif 可以处理图片的元数据。例如:可以读取数码相机照到的照片的元数据。
// With the exif extension you are able to work with image meta data.
// For example, you may use exif functions to read meta data of pictures taken from digital cameras
// by working with information stored in the headers of the JPEG and TIFF images.
//
// Windows 用户使用该扩展必须启用 mbstring 扩展,并且 mbstring 扩展必须在 exif 之前加在。
// Windows users must enable both the php_mbstring.dll and php_exif.dll DLL's in php.ini.
// The php_mbstring.dll DLL must be loaded before the php_exif.dll DLL so adjust your php.ini accordingly.
// --
//
// 函数
exif_imagetype()
// 1/1
// 获取图片的扩展,返回一个整数,对应于 exif 中的常量
exif_read_data()
// 1/4
// Reads the EXIF headers from JPEG or TIFF, 返回一数组
// EXIF headers tend to be present in JPEG/TIFF images generated by digital cameras,
// but unfortunately each digital camera maker has a different idea of how to actually tag their images,
// so you can't always rely on a specific Exif header being present.
exif_tagname()
// 1/1
exif_thumbnail()
// 1/4
// Retrieve the embedded thumbnail of a TIFF or JPEG image
read_exif_data()
// alias of exif_read_data()
相关文档:
在PHP中使用过SESSION的朋友可能会碰到这么一个问题,SESSION变量不能跨页传递。这令我苦恼了好些日子,最终通过查资料思考并解决了这个问题。我认为,出现这个问题的原因有以下几点:
1、客户端禁用了cookie
2、浏览器出现问题,暂时无法存取cookie
3、php.ini中的session.use_trans_sid = 0或者编译时没有 ......
JavaScript ==> PHP:
方法一: 先用PHP生成js代码,然后通过浏览器的自动刷新,将javascript变量传递到PHP脚本中。
注意:在实际应用中要防止用户在地址栏内更改传递的变量值。
<?php
if($qq) echo $qq.'<br>';
else echo "<scrip ......
找到一个能用的 分享给你吧
刚已经在本机做过认真测试,绝对无问题
(表结构:
id 表ID(唯一)
title 各类标题
flid 类别的ID (大类为1 中类为2 小类为3)
pid 上类的ID(大类就跟大类,提交中类的时候这地方写大类的ID,提交小类的时候写中类的ID) )
<?php
$link=mysql_connect("l ......
一、什么是数组
数组就是一组数据的集合,把一系列数据组织起来,形成一个可操作的整体。数组的每个实体都包含两项:键和值。
二、声明数据
在PHP中声明数组的方式主要有两种:一是应用array()函数声明数组,一是直接为数组元素赋值。
<1>array()函数声明的数组的方式array([mixed...]) 参数mixed的语法 ......
对http request过来的数据,凡是含有单引号,双引号,反斜线等都进行加斜线处理。防止进行注入操作。
/*
堵SQL漏洞
*/
function quotes($content){
//如果magic_quotes_gpc=Off,那么就开始处理
if (!get_magic_quotes_gpc()) {
//判断$content是否为数组
if (is_array($content)) {
//如果$content是 ......