Jump to content

strpos issue with SchedulesData.Class


natcret

Recommended Posts

I have recently started php logging in order to troubleshoot another issue I am having.  In the php log, it shows the following over and over:

Quote

[13-May-2017 10:54:15 America/Los_Angeles] PHP Warning:  strpos(): Empty needle in /xxxx/xxxx/phpvms/core/common/SchedulesData.class.php on line 157

Here is the code for that section:

Quote

    /**
     * Extract the code and flight number portions from the flight number
     * Ensures that the code and number are properly split
     */
    public static function getProperFlightNum($flightnum) {
        if ($flightnum == '') return false;

        $ret = array();
        $flightnum = strtoupper($flightnum);
        $airlines = OperationsData::getAllAirlines(false);

        foreach ($airlines as $a) {
            $a->code = strtoupper($a->code);

            if (strpos($flightnum, $a->code) === false) {
                continue;

            }

            $ret['code'] = $a->code;
            $ret['flightnum'] = str_ireplace($a->code, '', $flightnum);

            return $ret;
        }
 

 

Any ideas?

Regards,

Nat

Edited by natcret
Link to comment
Share on other sites

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...