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 DigitsIterator implements Iterator { | |
private $num; | |
private $radix; | |
private $temp; |
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
public class AuthService implements AuthServiceInterface { | |
private Logger logger; | |
// ... | |
public void setLogger(Logger logger) { | |
this.logger = logger; | |
} |
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 | |
$filename = 'data.txt'; | |
$delimiter = "\t"; | |
$file = new SplFileObject($filename, 'r'); | |
$file->setFlags(SplFileObject::READ_CSV); | |
$file->setCsvControl($delimiter); | |
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 | |
$dbh = new PDO(/* connection details */); | |
$query = ' | |
SELECT * | |
FROM table | |
WHERE col1 = :value1 | |
AND col2 = :value2 |
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 CsvIterator extends FileIterator | |
{ | |
/** | |
* @var string | |
*/ | |
protected $_delimiter; |
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 | |
$value = 0; | |
if ($_POST) { | |
$value = (int) $_POST['value']; | |
if (isset($_POST['inc'])) { | |
$value++; | |
} elseif (isset($_POST['dec'])) { | |
$value--; | |
} |
NewerOlder