how to limit sql column information

Asked

Viewed 47 times

0

good evening, in a script I use added this string to get some information,

<div class="col"><b><?= $this->lang->line('imei');?>:</b> <?=$db['custom_field'];?></div>

and the result is:

{"494d4549":"123456789098765"}

but only intended to present 123456789098765

How can I limit this information? Thank you.

  • 1

    Use 494d4549 key in the array.

  • Edit the question and a print_r($db); and put this information.]

2 answers

0

I’m not sure I understand the question, but I think what you’re looking for is this:

    <div class="col"><?=$db['custom_field'];?></div>

0

First, try not to use the short tags PHP, they can cause problems, because depending on the server where you host your source code, they may not be accepted.

Then you can use

array_values() [protótipo: array array_values ( array $input )]

to take only the key associated with the vector values (array).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.