[ create a new paste ] login | about

Link: http://codepad.org/jMjrUXBb    [ raw code | output | fork ]

PHP, pasted on Apr 15:
1
2
3
4
5
6
7
<?php

$s = "Acquired by the University in 1988";
preg_match("/\d{4}/", end($desc), $match);

#output the year.
print_r($match);


Output:
1
2
3
4
5
6
7

Warning: end(): Passed variable is not an array or object on line 4

Warning: preg_match(): Internal pcre_fullinfo() error -3 on line 4
Array
(
)


Create a new paste based on this one


Comments: