Re: I can't get in_array() to work
| From: | Andrei Zmievski | Date: | Mon, 02 Jul 2001 15:58:45 +0000 |
| Subject: | Re: I can't get in_array() to work | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1104@lists.php.net to get a copy of this message | ||
On Mon, 02 Jul 2001, Tomas Sanchez Romani wrote:
> Hi!
>
> I'm having a problem when calling PHP's function 'in_array(item, array)'
> from inside a template:
>
> {section name="anl" loop=$anl_info}
> ...
> <td class="textA{if in_array($anl_info[anl].typ,
> $soek_typer}{/if}">{$anl_info[anl].typ}</td>
> ^---------------------------------------------------------------^
> {/section}
>
> The if statement compiles to:
> <?php
> if (
> in_array ( $anl_info[anl].typ,
> $this->_tpl_vars['soek_typer']):
> ?>
> <?php endif; ?>
>
> but it should be, i think:
> <?php
> if (
> in_array (
> $this->_tpl_vars['anl_info'][$_smarty_sections['anl']['properties']['index']]['typ'],
> $this->_tpl_vars['soek_typer']):
> ?>
> <?php endif; ?>
>
> What can I do? because I really nedd to find out if this is true in some way.
Aren't you missing a ) right after $soek_typer?
-Andrei
* Proximity bug: when the program crashes in front of important visitors. *