Jump to content

Recommended Posts

Posted

Hi all

Could someone please help me out, I think the solution is so simple but I just can't see it with limited PHP skills.

Ok I have multiple airlines but my schedules all come under the airline code "NEX" as the other airlines are for charters, code share etc.

so I have filtered my NEX schedules on the results.tpl like so which works a treat:

 <?php
foreach($allroutes as $route)
{
if ($route->code != 'NEX') continue;

But I wanted to show two or more airline codes in the schedule results.tpl like "NEX" and"3XE" but not any others how would I adjust the code?

I've tried a few things but with no success.

Many thanks

Posted

You can have a look at logical operators here is a link that explains it http://php.net/manua...ors.logical.php

in your case now and without me being able to try it out

try

<?php
foreach($allroutes as $route)
{
if ($route->code != 'NEX' || '3XE') continue;

Many thanks, the link is very interesting I will have a good read through the whole thing time permitting, I tried the code you supplied but it didn't work, still only showed the NEX schedules.

Posted

i think this will work.

foreach($allroutes as $route)
{
if ($route->code != 'NEX' || $route->code != '3XE') { continue; }

You have to use OR ;) && wont work for this.

Thanks for this but it still doesn't work, its doing my head in now, it should be so simple :-(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...