This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* PHP DOM Sample */ | |
$books = array(); | |
$books [] = array( | |
'title' => 'PHP Hacks', | |
'author' => 'Jack Herrington', | |
'publisher' => "O'Reilly" | |
); | |
$books [] = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function evaluate($env, $expr) { | |
list($e, $v) = each($expr); | |
switch(strtolower($e)) { | |
case "add": | |
return evaluate($env, array_slice($v,0, 1)) + evaluate($env, array_slice($v, 1, 1)); | |
break; | |
case "multiply": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function orderSymbol($str1, $str2) | |
{ | |
$symbol = "++xx==--"; | |
$i = 0; | |
$u1 = -1; | |
$u2 = -1; | |
$d1 = -1; | |
$d2 = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$keys = array("name","date","event","location","address","description","link","linkname"); | |
foreach ($keys as $key) { | |
echo ($key . "<br>" . PHP_EOL); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title> | |
php sample programs.!!!!!! | |
</title> | |
</head> | |
<body> | |
<?php | |
echo "This is the first sample program in php.!!" | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enhance-PHP test sample | |
* | |
*/ | |
include_once "enhancephp/EnhanceTestFramework.php"; | |
// your classes and test fixtures | |
class ExampleClass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo true ? 'car' : false ? 'horse' : 'feet'; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class YourHandler extends MigrateDestinationHandler { | |
public function __construct() { | |
$this->registerTypes(array('node')); // тут типа регистрируешься для нодов | |
} | |
public function prepare($entity, stdClass $row) { | |
// это чтобы бить прицельно по типам данных | |
if (in_array($entity->type, array('eanews', 'eainterview', 'ealinksdossier', 'eaopinion'))) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>PhpFiddle Initial Code</title> | |
<script type="text/javascript"> | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo filter_var("[email protected]", FILTER_VALIDATE_EMAIL); | |
?> |