variable varible
Moderator: General Moderators
- SmokyBarnable
- Forum Contributor
- Posts: 105
- Joined: Wed Nov 01, 2006 5:44 pm
variable varible
In php is there a way to make a variable undecided?...not true and not false...not null yet defined.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- SmokyBarnable
- Forum Contributor
- Posts: 105
- Joined: Wed Nov 01, 2006 5:44 pm
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- dreamscape
- Forum Commoner
- Posts: 87
- Joined: Wed Jun 08, 2005 10:06 am
- Contact:
Subterfuge? That usually is used in the context of an activity.
Never heard it in the context of data. In its normal context, it means something that misrepresents the true nature of the activity, so I'm not sure where you get "undecided," because it is decided; it's just deceitful. So using that in the context of data the closest thing it seems to me would be scrambling or encryption, for which any cipher should do the trick.
Or, if you actually are looking for "undecided" variables, you do what all languages do for abstract concepts: You give it an actual value that the language can use to interpret as being the concept. Since PHP has no concept of "undecided" variables, you define your own context to interpret as being "undecided" within your application.
Never heard it in the context of data. In its normal context, it means something that misrepresents the true nature of the activity, so I'm not sure where you get "undecided," because it is decided; it's just deceitful. So using that in the context of data the closest thing it seems to me would be scrambling or encryption, for which any cipher should do the trick.
Or, if you actually are looking for "undecided" variables, you do what all languages do for abstract concepts: You give it an actual value that the language can use to interpret as being the concept. Since PHP has no concept of "undecided" variables, you define your own context to interpret as being "undecided" within your application.
Code: Select all
<?php
/**
* Making a new abstract data type 101
*/
// First, we'll make our data type a constant so it is easy to find
define('undecided', 'HELP ME! I do not know what the hell I am!');
// Then we'll make a function similar to the other is_* functions
function is_undecided($var)
{
return ($var === undecided);
}
// Congratulations! You've just made a new abstract data type
// Assign it to a variable like this:
$var = undecided;
// And check it like this:
if (is_undecided($var))
{
see_guidance_counselor();
}- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US