Hello Dominik,
Dominik B. wrote:
I'm executing these commands:
$text="example text";
$parts=explode(" ", $text);
$result=$parts[0];
$result becomes a weird array.
echo "$result" prints 'example',
but if I use function count_chars($result) i got error message, that
$result is an array not a string.
Please tell me how to make my $result be a string
There's nothing wrong with the code you posted,
I tried it on my machine.
What may be causing some confusion is count_chars().
Please realize that this function is _not_ for getting
the string length. Instead it by default returns an array
of all possible characters and the number of times they occur
in the string.
If you want a function that simply returns the string length,
then strlen() is what you're looking for.
Best regards,
Eric