codeigniter var_dump size output not ok

174 Views Asked by At

Someone can tell me why it output this :

array(4) {
[0]=>
string(2) "52"
[1]=>
string(10) "Tofu ferme"
[2]=>
string(1) "1"
[3]=>
string(17) "paquet(s)"
}

The 17 ??

1

There are 1 best solutions below

0
On

This is most likely to padding (either from left or right of string). Try VIEWING SOURCE of your var_dump() and not the html generated. The HTML source might show you padding.

You could clean up the padding by running a simple trim() function on the variable.

Otherwise I am just guessing since you show very little in your question. You could offer more input on what this variable is, and where you get this questionable french string length.