I have in a input text the following information:
Friday, February 9, 2007.
I want to extract of there on Friday.
I appreciate a prompt help...
![]()
I have in a input text the following information:
Friday, February 9, 2007.
I want to extract of there on Friday.
I appreciate a prompt help...
![]()
Code:function analizarFecha($fecha) { $d = array(1 => 'día', 'mes', 'fecha', 'año'); $r = array(); $m = array(); preg_match('/(\w+), (\w+) (\d+), (\d+)/', $fecha, $m); foreach($m as $k => $v) if(isset($d[$k])) $r[$d[$k]] = $v; return $r; } $fecha = analizarFecha($_GET['fecha']); print $fecha['día']; // "Friday"
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
ok thank you for your help...
Bookmarks