Solved

Very EASY question

Posted on 2000-03-21
3
137 Views
Last Modified: 2013-12-25
I want to test a variable if it has got characters in it. Somehow this doesn't work. Can someone provide me with the correct code ?

if $form{$key}='' {
 print "allright";

  }
0
Comment
Question by:oostwijk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:oostwijk
ID: 2642244
I ment to say:

if $form{$key}="" {
 print "allright";
  }
0
 
LVL 16

Accepted Solution

by:
maneshr earned 25 total points
ID: 2642273
try this....

if ($form{$key}){ ## Key DOES have a value in it!!
  print "All right\n";
}else{
   print "Empty :-( \n";
}
0
 

Author Comment

by:oostwijk
ID: 2651343
Ok, that works fine...
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question