Im trying to explode the value of my query to input field so im able to edit them: this what I've got so far ::

$temp = explode(',',$sizes);
        if($temp){
                $ctr_size='';       
                foreach($temp as $size){
                echo "<input type='text' value". $size.">";
                $ctr_size++;
                }
        }

please help..

Re: Explode value to input field 80 80
Member Avatar

I'm assuming that you mean the result of your query. As we don't know the content of your $sizes variable, impossible to say if it will work or not.

In addition:

$ctr_size='';

should be:

$ctr_size=0;

However, it's not being used in your code, so I don't see the point of it.

I'm assuming this should be:

echo "<input type='text' value='" . $size. "'>";

Notice the equals sign and the addition of single quotes.

Re: Explode value to input field 80 80

yeah I forgot those single qoutes!. :)

thnx for your help Sir diafol :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.