Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8090461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:43:52+00:00 2026-06-05T19:43:52+00:00

I have a pretty nasty error I can’t get rid of. Here’s the function

  • 0

I have a pretty nasty error I can’t get rid of. Here’s the function causing the issue:

    function get_info_by_WatIAM($WatIAM, $info) { 
    $users_info = array();
    exec("uwdir -v userid={$WatIAM}", $users_info);
    foreach ($users_info as $user_info) {
        $exploded_info = explode(":", $user_info);
        if (isset($exploded_info[1])){              
            $infoArray[$exploded_info[0]] = $exploded_info[1];
        } 
    }
    return $infoArray[$info];   }

Here’s what’s calling the function:

} elseif (  empty(get_info_by_WatIAM($_POST['ownerId'])) ) { ... 

I would really appreciate any suggestion. Thanks very much!

If the code doesn’t make sense, here’s a further explanation: exec uses a program that stores information on all the users in a school. These include things like faculty, name, userid, etc. The $_POST['ownerId'] is a username — the idea is that, upon entering a username, all of the user’s information is automatically filled in

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:43:55+00:00Added an answer on June 5, 2026 at 7:43 pm

    You do not need empty around function calls, in fact empty only works with variables and not functions (as you see). You only need empty if you want to test a variable that may not be set for thruthiness. It is pointless around a function call, since that function call must exist. Instead simply use:

    } else if (!get_info_by_WatIAM($_POST['ownerId'])) { ... 
    

    It does the same thing. For an in-depth explanation, read The Definitive Guide To PHP’s isset And empty.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pretty monstrous Java app in development here. As of now, it's
I have pretty much the same question as stated here: Set listener for store
I've got a nasty problem with some code and can't see the error. I
I have pretty unassuming preferences screen based on PreferenceActivity . (You can see it
I've found a pretty nasty bug in EF 4.1 Code First. Assume we have
I have pretty good skills in PHP , Mysql and Javascript for a junior
i have pretty simple simple question (i hope so). How do i change the
I have pretty standard Qmail toaster installation. I'm using the dot files to set
I might have pretty basic question about regex. I have the following regex, which
I have built a PHP calendar system and have pretty much everything done but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.