I found an answer: the right hand operand is evaluated only if the left one is false. So if ScriptThatMightReturnTRUE returns false then the value returned by ScriptThatReturnsString will be get assigned to answer.
Right, but in this example what ends up in the var answer? If left operand is true, answer is assigned boolean true? If left operand is false the string from the right operand is assigned to answer?
answer = (ScriptThatMightReturnTRUE) || (ScriptThatReturnsString);
I am doing code archeology (digging up someone else's code) and I see the use of two vertical bars in what appears to be a bitwise operator. Can't find any explanation of this on the web and my experiemt below doesn't really explain it all. The code I dug up looks like this:
answer =...
The best thing about an IDE is the ability to step thru the code one line at a time while watching var values. A "good editor" can't do this and neither can Kdevelop. Can PHP Storm?? do this?
problem solved
Okay, so on Godaddy servers there is a file called .user.ini in the public_html folder that lets you set parms that would normally be in php.ini. Make sure your ftp client has "show hidden files" turned on.
Avoid errors. why didn't I think of that!
Putting a php.ini in root web folder "/" with error_reporting set to On does nothing.
My php.ini has
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On
display_startup_errors = on
After I upgraded my server I stopped getting PHP errors displayed. Now, when there is a typo, the browser is blank there is nothing. Firefox and IE both do this. If I find the typo and fix it then the browser displays what I have in the script. I have no php.ini
In my script I have the...
I don't think I need to take into account the the "meaning" of the phrases and trying to do so would require delving, unnecessarily, into natural language processing. I would be satisfied to have an algorithm that determines whether any possible disentanglement of the word jumble results in a...
Trying to write a PHP function that disentangles a jumble of words. I already have something written but it is imperfect.
liquidweather: liquid weather OR liquid we at her ?
If your answer is the latter doesn't make sense then the solution becomes very difficult. Code to determine the meaning...
I created a a database table in MySQL called placenames -a simple list of 260K place names. The following code finds a name in the table super fast.
$result = mysql_query("SELECT * FROM placenames");
while($row = mysql_fetch_array($result))
{ if ($place == $row['placename']) { do whatever etc...
After struggling with sqlite database versions, GoDaddy, management tools and functions meant for version 2 (sqlite_open) versus functions meant for version 3 (PDO) --I got this working. I created and loaded the DB with the Firefox plugin SQLite Manager then just used PDO statements.
I'm not...
I created a database with "SQLite Manager" and I can query the two tables with that tool but this line:
$handle = sqlite_open($db) or die("Could not open database");
causes this error:
Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database in /full spec of db...
I want to do something which sounds very very simple but which has turned out to be incredibly difficult. I want to create a sqlite database with two one field tables of unicode text. I load the data from two text files. One is simply a list of surnames and the other a list of unicode place...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.