OCI8 for PHP(Oracle Connection)值带有空格(已完成到全长)

I am using OCI8 for PHP for connecting to an Oracle 11g database.

Everything is working fine, but the imported values from Oracle database come with spaces, completed to full lenght.

For example, the value on DB is with NCHAR(10 CHAR)

'value'

OCI8 returns

'value     ' 

with 5 spaces, 10 chars total.

Any ideas or recommendations?

Yes, all *char types in Oracle have spaces appended all the way to the end, this is not PHP-specific. Use RTRIM() if you don't want them:

SELECT RTRIM(field_name) AS field_name ...

... or PHP's own rtrim() of course.