Answer the question
In order to leave comments, you need to log in
How to turn a 2D array (result of fetchAll from Doctrina) into a string?
Hi
I'm tired of writing crutches, I'm sure that I just don't know something.
$foo = $app['dbs'][$bd] -> fetchAll(SELECT id FROM bar);
Answer the question
In order to leave comments, you need to log in
php.net/manual/en/function.serialize.php
php.net/manual/en/function.json-encode.php Wo
n't work
?
The problem is that the lines are different.
the array can be output by the print_r function - this is also a string.
can be translated into json - this is also a string.
You can use the built-in serialize - this is also a string.
And there is also md5, look - also a line in the output.
You can still use 5-10 pieces of all sorts of ready-made tools and still write as many of your own, but you probably need some specific format that you want to use for something.
stackoverflow.com/a/10852752 DoctrineExtensions
has a GroupConcat function
entity_managers:
default:
dql:
string_functions:
GROUP_CONCAT: DoctrineExtensions\Query\Mysql\GroupConcat
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question