You are here: Re: break apart a variable « PHP Programming Language « IT news, forums, messages
Re: break apart a variable

Posted by Auddog on 02/07/07 20:49

OK, I see the errors of my way. I now get :

<input name="hours[20]" type="text" size="4" maxlength="4">

I cut and pasted you code into the top part of my page - here is the code:

<?php

if (isset($_POST['submitted'])) {

$hours = array();
foreach($_POST as $key => $value){
if(preg_match('/^[0-9]+-hours$/i',$key)){
$keyarray = explode('-',$key);
$hours[$keyarray[0]] = $value;
}
}
print_r($hours);


//if - else statement isset
} else {

?>

When I run this all I get is array ( ) - is there something else I'm
missing.



"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:op.tnd93ac9qnv3q9@misant.kabel.utwente.nl...
Auddog <will_k@hotmail.com> wrote:

> Here is what my input looks like from my browser (view page source):
>
> <input name=hours['.3.'] type=text size=4 maxlength=4 >
>
> Is that the same? I'm sorry for being slow at getting this.

No, it is not. I gave you the code. Copy/paste it if need be.

--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация