PHP Affichage de tout les cookies

echo "<PRE>";print_r($HTTP_COOKIE_VARS);echo "</PRE>";

PHP 合并XML / XSL

//Merge XML/XSL
$ficXsl = '/www/docs/suivi_cmd/xsl/detail_commande_emballage.xsl';
$DomXml = domxml_open_mem(stripslashes($strXml),DOMXML_LOAD_PARSING + DOMXML_LOAD_COMPLETE_ATTRS + DOMXML_LOAD_SUBSTITUTE_ENTITIES + DOMXML_LOAD_DONT_KEEP_BLANKS);
$DomXsl = domxml_xslt_stylesheet_file($ficXsl);
$result = $DomXsl->process($DomXml);
$DomXml->free();
$result = $DomXsl->result_dump_mem($result);

JavaScript 搜索栏Google

<!-- Search Google -->
<center>
<form method="get" action="http://www.google.com/custom" target="google_window">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
<a href="http://www.google.com/">
<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a>
<input type="text" name="q" size="35" maxlength="255" value=""></input>
<input type="submit" name="sa" value="Search"></input>
<input type="hidden" name="client" value="pub-1280039572425172"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="5016850435"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="safe" value="active"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:CCCCCC;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:50;LW:190;L:http://www.cultivategreatness.com/images/cg_logo.gif;S:http://www.cultivategreatness.com;FORID:1"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
</center>
<!-- Search Google -->

C++ wxMessageBox示例

wxMessageBox( wxT("Hello world!"), wxT("Welcome to wxWindows!"), wxOK|wxICON_INFORMATION, this );

wxMessageBox(  wxT("Goodbye world!"),  wxT("Bye bye!"), wxOK|wxICON_INFORMATION, this );

PHP Vérifier une adresse电子邮件saisie par un utilisateur

// Vérifie la validité de l'email
function est_email ($adresse) { 
	$reg = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]*[.][a-z]{2,3}$";
	$email = ereg($reg,$adresse);
	if ($email) 
	{
		return TRUE;
	}
}

if (!est_email("http://caphar@lepotlatch.org")) 
{
	print "Ce n'est pas un e-mail";
}

// Renvoie "Ce n'est pas un e-mail"

PHP Couper untexteÃ100caractèresanscouper un mot

// Coupe un texte à $longueur caractères, sur les espaces, et ajoute des points de suspension...
function tronque($chaine, $longueur = 120) 
{
 
	if (empty ($chaine)) 
	{ 
		return ""; 
	}
	elseif (strlen ($chaine) < $longueur) 
	{ 
		return $chaine; 
	}
	elseif (preg_match ("/(.{1,$longueur})\s./ms", $chaine, $match)) 
	{ 
		return $match [1] . "..."; 
	}
	else 
	{ 
		return substr ($chaine, 0, $longueur) . "..."; 
	}
}
print tronque("Ceci n'est pas un tuyau",12);
// Renvoie Ceci n'est pas...

Other css字体速记

div {
font: normal uppercase bold 1em/1.6em verdana, arial, sans-serif;
}

PHP isInteger

function isInteger($n) {
  if (preg_match("/[^0-^9]+/",$n) > 0) {
    return false;
  } return true;
}

C++ 显示当前路径

#include <direct.h>
#include <stdlib.h>
#include <iostream.h>

int main()
{
  char CurrentPath[_MAX_PATH];
  getcwd(CurrentPath, _MAX_PATH);
  cout << CurrentPath << endl;
  
return 0;
}

Bash 用fgrep找一个空行

cat -A file_name.txt | fgrep -U -n -x $