Im new to php so anyhelp would be greatly appreciated.
im pulling data from a sql database and the data consists of itemcodes
and qauntitys. my problem is that the item codes contain information about an item.
it 1001xl 1000m same item different size
how could i parse the output to look like
item m xl
1001 1 1
??
anyhelp would be greatly appreciated, thanks.
newbie at php , need help with ereg function and arrays
Moderator: General Moderators
- massiveone
- Forum Commoner
- Posts: 29
- Joined: Tue Jun 18, 2002 4:39 pm
- Location: Canada
- Contact:
- Johnm
- Forum Contributor
- Posts: 344
- Joined: Mon May 13, 2002 12:05 pm
- Location: Michigan, USA
- Contact:
You could use this:
http://www.php.net/manual/en/function.parse-str.php
and concatenate the first four items in the array then echo the remaining items with the proper spacing.
Direwolf
http://www.php.net/manual/en/function.parse-str.php
and concatenate the first four items in the array then echo the remaining items with the proper spacing.
Direwolf
- massiveone
- Forum Commoner
- Posts: 29
- Joined: Tue Jun 18, 2002 4:39 pm
- Location: Canada
- Contact:
trouble coding
thankyou for the helpful page.
im still having trouble coding it though as im new to this ;op
could you give me some example syntax
im still having trouble coding it though as im new to this ;op
could you give me some example syntax
- Johnm
- Forum Contributor
- Posts: 344
- Joined: Mon May 13, 2002 12:05 pm
- Location: Michigan, USA
- Contact:
Look at this:
The value of the var $word is a string of which can be referd to as an array.
Direwolf[/quote]
Code: Select all
<?
$word="100110";
$first_string=$wordї'0'].$wordї1].$wordї2].$wordї3];
echo $first_string." ".$wordї4]." ".$wordї5];
?>Direwolf[/quote]