Fatal error: Call to undefined function aary()

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 1783 Views - Last Post: 02 March 2013 - 07:56 PM Rate Topic: -----

#1 ak4744710   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 136
  • Joined: 30-January 13

Fatal error: Call to undefined function aary()

Posted 28 February 2013 - 05:29 AM

I am getting the error Fatal error: Call to undefined function aary() in C:\wamp\www\MultiDimensionalArray.php on line 57
Can someone show me what is wrong with my code and maybe correct it thanks I will add to reputation of first correct answer (That I understand of course lol). Also if testing code please remember to delete the "57" in the begining of the line as I do not have that in my code I simply added that to show line 57 to you for potential help with error.
<?php
echo"<html>\n";
echo"<head>\n";
echo"<title>Multi Demensional Array</title>\n";
echo"<head>\n";
echo"<body>";
echo"<h1>Array Example</h1>\n";
echo"<hr>";
echo"<br>";
$a1 = array(
		"fName" => "Michael",
		"lName" => "Scott",
		"profession" => "World's Best Boss",
		"bd" => "8/16/1969",
		"aka" => "Steve Carell"
		);

$a2 = array(
		"fName" => "Pam",
		"lName" => "Beesly",
		"profession" => "Receptionist",
		"bd" => "3/7/1978",
		"aka" => "Jenna Fischer"
		);

$a3 = array(
		"fName" => "Jim",
		"lName" => "Halpert",
		"profession" => "Salesman",
		"bd" => "10/20/1979",
		"aka" => "John Krasinski"
		);

$a4 = array(
		"fName" => "Dwight",
		"lName" => "Schrute",
		"profession" => "Assistant to the Regional Manager",
		"bd" => "1/20/1972",
		"aka" => "Rainn Wilson"
		);

$a5 = array(
		"fName" => "Meredith",
		"lName" => "Palmer",
		"profession" => "Customer Relations Representative",
		"bd" => "4/19/1954",
		"aka" => "Kate Flannery"
		);

$a6 = array(
		"fName" => "Ryan",
		"lName" => "doe",
		"profession" => "computer programer",
		"bd" => "8/30/1954",
		"aka" => "Rabbit"
		);
  57                  $aryValues=aary($a1,$a2,$a3,$a4,$a5,$a6);
foreach ($aryValues as $value)
{
foreach ($value as $k=>$v){
switch($k){
	case "fname";
	$k="First Name:";
	break;
case "lName":
	$k="Last Name:";
	break;
case "proffesion";
	$k="proffesion:";
	break;
case "bd";
	$k="Birthday:";
	break;
case "aka";
	$k="AKA:";
	break;
  }
echo" <strong>".$k."</strong> ".$v."<br>\n";;
}
echo" <br>\n";
}
echo" </body>\n";
echo" </html>\n";
?>



Is This A Good Question/Topic? 0
  • +

Replies To: Fatal error: Call to undefined function aary()

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: Fatal error: Call to undefined function aary()

Posted 28 February 2013 - 06:01 AM

Fatal error: Call to undefined function aary() in C:\wamp\www\MultiDimensionalArray.php on line 57

You just can't get much clearer than that! Do you have a function named aary? Does PHP have a function with that name?

I'm sorry but if that error message is unclear to you, then programming likely is not in your future.
Was This Post Helpful? 2
  • +
  • -

#3 raghav.naganathan   User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 410
  • View blog
  • Posts: 1,449
  • Joined: 14-September 12

Re: Fatal error: Call to undefined function aary()

Posted 28 February 2013 - 06:14 AM

Well, I wouldn't like to be harsh on you...but most of the time, the error actually gives you the clue as to what is the problem with the program...in your case, undefined function...so all you need to do is look at the line number and check if you have a function defined by that name...

Don't worry...it will come with practice and constantly keeping in touch with programming.

regards,
Raghav
Was This Post Helpful? 1
  • +
  • -

#4 ak4744710   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 136
  • Joined: 30-January 13

Re: Fatal error: Call to undefined function aary()

Posted 28 February 2013 - 08:30 AM

View PostJackOfAllTrades, on 28 February 2013 - 08:01 AM, said:

Fatal error: Call to undefined function aary() in C:\wamp\www\MultiDimensionalArray.php on line 57

You just can't get much clearer than that! Do you have a function named aary? Does PHP have a function with that name?

I'm sorry but if that error message is unclear to you, then programming likely is not in your future.

no one said the message was unclear I understand the message Im not sure if my question was unclear or if you just did not read the whole thing dont answer just to be rude if your not going to help leave peoples posts alone.

View Postraghav.naganathan, on 28 February 2013 - 08:14 AM, said:

Well, I wouldn't like to be harsh on you...but most of the time, the error actually gives you the clue as to what is the problem with the program...in your case, undefined function...so all you need to do is look at the line number and check if you have a function defined by that name...

Don't worry...it will come with practice and constantly keeping in touch with programming.

regards,
Raghav

Thank you for the polite reply I do know that it is saying it is undefined so I am assuming that I need to define global but I was not sure if this is what it meant our not thanks
Was This Post Helpful? 0
  • +
  • -

#5 AdaHacker   User is offline

  • Resident Curmudgeon

Reputation: 463
  • View blog
  • Posts: 820
  • Joined: 17-June 08

Re: Fatal error: Call to undefined function aary()

Posted 28 February 2013 - 01:49 PM

View Postak4744710, on 28 February 2013 - 10:30 AM, said:

Thank you for the polite reply I do know that it is saying it is undefined so I am assuming that I need to define global but I was not sure if this is what it meant our not thanks

What? No, you don't need to define anything. Just look at line 57 - "aary" is clearly a typo. You were trying to type a similar word and typed "aary" by mistake, so you just need to correct it. The correct code should be obvious from the context.

The reason PHP reports it as an "undefined function" is because it's not smart enough to know that the error is a typo. It doesn't know what "arry" is, but it sees the parentheses and assumes that you were trying to call a function that you didn't define.
Was This Post Helpful? 1
  • +
  • -

#6 ak4744710   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 136
  • Joined: 30-January 13

Re: Fatal error: Call to undefined function aary()

Posted 28 February 2013 - 05:04 PM

View PostAdaHacker, on 28 February 2013 - 03:49 PM, said:

View Postak4744710, on 28 February 2013 - 10:30 AM, said:

Thank you for the polite reply I do know that it is saying it is undefined so I am assuming that I need to define global but I was not sure if this is what it meant our not thanks

What? No, you don't need to define anything. Just look at line 57 - "aary" is clearly a typo. You were trying to type a similar word and typed "aary" by mistake, so you just need to correct it. The correct code should be obvious from the context.

The reason PHP reports it as an "undefined function" is because it's not smart enough to know that the error is a typo. It doesn't know what "arry" is, but it sees the parentheses and assumes that you were trying to call a function that you didn't define.

Thank you I actually already found that a few hours ago after some people decide to get rude instead of looking at peoples code because I was pretty sure I did it correct and noticed the typo as well I did rate you though as if I didn't find it this would have been a great help thank you very much
Was This Post Helpful? 0
  • +
  • -

#7 creativecoding   User is offline

  • Hash != Encryption
  • member icon


Reputation: 931
  • View blog
  • Posts: 3,216
  • Joined: 19-January 10

Re: Fatal error: Call to undefined function aary()

Posted 28 February 2013 - 09:24 PM

Not many people like using their volunteer time on people who didn't even both reading the error.
Was This Post Helpful? 4
  • +
  • -

#8 ak4744710   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 136
  • Joined: 30-January 13

Re: Fatal error: Call to undefined function aary()

Posted 01 March 2013 - 03:30 AM

View Postcreativecoding, on 28 February 2013 - 11:24 PM, said:

Not many people like using their volunteer time on people who didn't even both reading the error.

yeah thats the thing was I read the error I knew where it was and people act like your stupid because you over look something like a typo they sit there3 and dont even read the question or the code they just try to use the forums for a power trip and think its a easy way to run their mouth to people its down right rude really its like there really not vaulentering any time by writing people talking to them like they are stupid yet offering no advice which I see a lot of people do in forums I dont really get it that first dude was so rude trying to tell me if I dont understand the error bla bla bla lol c'mon I pointed out where the error was my self in my question apparently I understood it was him who did not and if he was not intelligent enough to understand a simple question maybe he has no business in programming our maybe he did not know either just makes him feel big to run the mouth in forums like so many do if they do not want to help people they should not even sign in. I am new to a lot of this programing stuff and I appreciate any help I get and am always willing to help others as well with anything I may already know but if I dont know the answer rather than be a jerk just to make myself heard I just keep my mouth shut. I dont understand are peoples lives that boring they have nothing better to do then sit around and read forums they have no intent on helping with or they dont know the answer but just to make their selves heard they have to say something if they dont know the answer or want to help steer someone the right way they should just mind their own business I could answer a million posts if I just want to act like a idiot and not even help people just make rude comments and say stuff that makes me look stupid like telling them things they already know like the first guy tried to do with me by telling me stuff that was already in my post LMFAO get a life.
Was This Post Helpful? 0
  • +
  • -

#9 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4240
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Fatal error: Call to undefined function aary()

Posted 01 March 2013 - 04:50 AM

I'm sorry, but I honestly had to give up on that last post a few lines in. Not really because of what you were saying, but because of the lack of any coherent structure. Proper grammar exists for a reason. Please use it.

Anyway. If you think what Jack said was rude to the point where that rant is justified, you are pretty much just making his point for him. What he said was in fact not rude at all. All he did was point out - rather bluntly, admittedly - what appears to be a pretty sizable gap in your skill-set. Not to be rude or superior, but rather so you could benefit from it. We aren't here to coddle you and make you feel good about yourself. We are here to help you become a better programmer.

The fact is, that error message is about as clear as they come. Relatively speaking, it more or less does everything short of rewriting the code for you. It shouldn't be hard to figure out, even for somebody new to the field. It's something you need to work on. Take it as an insult if you must, but it isn't meant as an insult.
Was This Post Helpful? 0
  • +
  • -

#10 ak4744710   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 136
  • Joined: 30-January 13

Re: Fatal error: Call to undefined function aary()

Posted 01 March 2013 - 05:41 AM

View PostAtli, on 01 March 2013 - 06:50 AM, said:

I'm sorry, but I honestly had to give up on that last post a few lines in. Not really because of what you were saying, but because of the lack of any coherent structure. Proper grammar exists for a reason. Please use it.

Anyway. If you think what Jack said was rude to the point where that rant is justified, you are pretty much just making his point for him. What he said was in fact not rude at all. All he did was point out - rather bluntly, admittedly - what appears to be a pretty sizable gap in your skill-set. Not to be rude or superior, but rather so you could benefit from it. We aren't here to coddle you and make you feel good about yourself. We are here to help you become a better programmer.

The fact is, that error message is about as clear as they come. Relatively speaking, it more or less does everything short of rewriting the code for you. It shouldn't be hard to figure out, even for somebody new to the field. It's something you need to work on. Take it as an insult if you must, but it isn't meant as an insult.

I know what you are saying, but the point is I knew what the error meant I just did not notice the typo. Instead of pointing out the obvious and what I already said all he had to do was tell me there is a typo or not say anything. Insulting a persons intelligence is not making them a better programmer it is just treating them like they are stupid. I do not see what people get out of downgrading others I am always polite and helpful when I answer a post or I keep my mouth shut.
Was This Post Helpful? 0
  • +
  • -

#11 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4240
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Fatal error: Call to undefined function aary()

Posted 01 March 2013 - 06:35 AM

You didn't said anything about understanding the error until well after Jack replied to your first post. All you said in your first post was that you were getting this error, and then you asked us to show you what is wrong. You even made a point to mention that you'd up-vote the first answer you understood. How could we possibly not assume that the problem was that you didn't understand the error?

You are taking what Jack said all wrong. I seriously doubt it was meant as an insult to you, only a blunt statement of fact. Given what you posted, it was perfectly reasonable to assume you didn't understand the error. Given that, your prospects of going far as a programmer didn't look very promising. Not without some serious effort put into learning how to interpret error messages better. That would have been the goal: to get you to realize that. People of Jacks standing on sites like these don't get there by going around lashing out at people, like you seem to think he's doing.
Was This Post Helpful? 0
  • +
  • -

#12 ak4744710   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 136
  • Joined: 30-January 13

Re: Fatal error: Call to undefined function aary()

Posted 01 March 2013 - 07:38 AM

Well I can kind of see your point there, however I did point out that I knew the error was on line 57 I just could not figure out why I was getting a error. Jack tried to tell me what the error meant instead of what the error was. I thought it was quite obvious that I knew what the code meant, but without realizing the typo you can see where I got confused. I am not saying that he is not good at helping people his reputation speaks for itself. I was only saying he did not help me. I never asked what the error meant only what my error was, and I browse a lot of forums, some for help and some to help others and have noticed a lot of people getting cocky like that with others as well. This tells me it is not just me I have always been kind polite and to the point and would not expect anything else when asking for help. If the grammar of a new person to programing irritates people they should simply say nothing at all rather than being rude this is my whole point. I am very new to php so I assume I am not always going to use the correct terms at first on every post however my question was pretty clear when I said please show me my error not please point out what it means. People have the right to not respond at all if they do not want to help you but it is uncalled for to answer someone with a answer that is not what they are even asking about, if I asked what is your favorite color and you tell me the definition of color that is not what I was asking for. That would show you did not read my question all the way through. This is what he did to me I asked for the error not what the error means.

Also I knew how to look for the error unfortunately I did not see a typo at first so I of course was thinking it had to be a syntax error but it said it was a fatal error so this was very confusing until I noticed that array was misspelled.
Was This Post Helpful? 0
  • +
  • -

#13 creativecoding   User is offline

  • Hash != Encryption
  • member icon


Reputation: 931
  • View blog
  • Posts: 3,216
  • Joined: 19-January 10

Re: Fatal error: Call to undefined function aary()

Posted 01 March 2013 - 09:37 AM

The thing is, the error desribes perfectly what your mistake was.

I suggest the method "rubber ducking". Get yourself a stuffed animal or rubber ducky, and when you get to an error that you're having trouble fixing, talk to it. I'm not even joking, it's what I do and it works. Explain what the problem is and go step by step what your code says and what it's doing.

Sorry if we seem rude at times but, like mentioned before, we don't have time/energy to help with such simple problems.

This post has been edited by creativecoding: 01 March 2013 - 09:40 AM

Was This Post Helpful? 0
  • +
  • -

#14 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4240
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Fatal error: Call to undefined function aary()

Posted 01 March 2013 - 09:58 AM

Well, I know a lot of other forums tend to just provide the solutions with little or no back-story to explain why it works or how they arrived at it (SO comes to mind), but around here we encourage people to explain things and help people work through their problems, rather than just provide the solutions. It's a lot more rewarding for the person asking the question. Like I say, we want to help people become better a programming, not just to solve whatever they are currently stuck on.

Besides, "show me my error" isn't as clear as you make it out to be. It could be interpreted as a request for a location of some specific error in your code, which is what you seem to have wanted; or it could be a more general requests for details about what you did wrong, which is more likely how people around here would take it. - Depends on how you choose to see this forum and it's purpose.

And, again, you keep saying Jack was rude. That's not at all the case. He was being blunt. There is a big difference. It wasn't an attack on you, just a no-nonsense statement of fact.

CC said:

... we don't have time/energy to help with such simple problems.

I wouldn't say that, exactly. I'd definitely have helped, but in the same way Jack did.
Was This Post Helpful? 1
  • +
  • -

#15 ak4744710   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 136
  • Joined: 30-January 13

Re: Fatal error: Call to undefined function aary()

Posted 02 March 2013 - 05:46 PM

View Postcreativecoding, on 01 March 2013 - 11:37 AM, said:

The thing is, the error desribes perfectly what your mistake was.

I suggest the method "rubber ducking". Get yourself a stuffed animal or rubber ducky, and when you get to an error that you're having trouble fixing, talk to it. I'm not even joking, it's what I do and it works. Explain what the problem is and go step by step what your code says and what it's doing.

Sorry if we seem rude at times but, like mentioned before, we don't have time/energy to help with such simple problems.

lol if this seriously works I know you said your serious I am willing to try anything that may help I am very motivated and take this serious
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2