PHP $row в массивPhp

Кемеровские программисты php общаются здесь
Anonymous
PHP $row в массив

Сообщение Anonymous »


while($row = mysql_fetch_array($result)) At the moment my $row['content'] has four strings inside it, how can I get them into seperate objects in an array?

As in 0 > "first string"

1 > "second string" etc...

At the moment they are all bundled into one it seems... But I need them seperated in an array.

I am new to PHP and have spent ages trying to find out how to do this.

Thanks in advance.

print_r ($row['content']); Returns:

hello world!another oneand another one...more coming... var dump of $row returns:
array(4) { [0]=> string(1) "1" ["id"]=> string(1) "1" [1]=> string(12) "hello world!" ["content"]=> string(12) "hello world!" } array(4) { [0]=> string(1) "2" ["id"]=> string(1) "2" [1]=> string(11) "another one" ["content"]=> string(11) "another one" } array(4) { [0]=> string(1) "3" ["id"]=> string(1) "3" [1]=> string(18) "and another one..." ["content"]=> string(18) "and another one..." } array(4) { [0]=> string(1) "4" ["id"]=> string(1) "4" [1]=> string(14) "more coming..." ["content"]=> string(14) }

Источник: https://stackoverflow.com/questions/117 ... w-to-array

Вернуться в «Php»