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 =...
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...
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...
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...
I built a Linux based app with a MySql database and I want people to install it by just taking the app folder with the database in it and have the app be able to access the DB. Currently, to install my app the user has to create a database and load the data which is a pain in the neck.
Have...
I am loading an array with data from a text file and it dies with no error well before it finishes. The script works fine on one server but not on another. The file is 2703 KB with 296700 rows --so the script should loop 296700 times to load the data into the array. I already changed...
I have a list of place names in a text file ordered by how well known the place is. I want to load the list into a simple one field table in Mysql and preserve the order in which it is loaded. When I list out the table it is listed alphabetically. Using PHP, how can I preserve the original order...
I have been getting a lot of blank screens lately when trying to run a PHP script with the slightest error. Firefox shows a blank screen but IE produces "The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be displayed " for the same script.
I...
Why do both the explode and preg_split functions eat up the available 32MG of memory on my server resulting in a Fatal error? Kinda crazy that it does. (I un-commented the explode and got same error.) The data has a lot of Unicode non-English chars.
$len = mb_strlen($FileContents);
echo '<br>...
I am seeing my server crash when I try to install SQL
Server 2008. The server is a newly built Windows Server 2008 with no history of use for anything!
When I get to the setup screen where you choose between "windows security" and "mixed mode", I can switch back and forth between the tabs on...
I am trying to read a 25 MG file with UTF-8 words in it, massage the data and then write it back out preserving the UTF-8 encoding. Is there a way to read in an EOL terminated line one at a time and preserve the UTF-8?
Binary safe fread and fwrite recognize EOF but not EOL.
I have a PHP script that calls PREG_MATCH_ALL in a loop. The purpose is to test a series of regexs. The script is supposed to call preg_match_all 112 iterations in a loop but with > 9500 bytes search string it dies after about 100 iterations. The larger the input string the sooner preg_match_all...
Is it really a good programming practice to deal with or get rid of ALL Notices in your PHP?
I get these a lot:
Notice: Array to string conversion in /home/content/f/r/e/fred111/html/myfolder/tects2.php on line 147
I call preg_match_all repeatedly in a loop and the script works fine. If however I pass preg_match_all a really big text string to search in, the script just dies after the nth time I call preg_match_all. The larger the input string the fewer times I can call preg_match_all before the script...
I seem to get errors a lot because strlen just gives the length but positions with a string are different because the first char is position zero.
When determining whether a given position within a string is out of range (passed the the end of string) sometimes I use '>=' other times I compare...
User enters text into HTML form and text, with CRLFs, is passed via POST method to PHP script. I var_dump text but all CRLFs are stripped out. Why? How can I preserve CRLFs in the PHP string value?
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.