FAQ

Search Discussions

1,297 discussions - 2,481 posts

  • Another way to declare a variable global is by prefixing it with the keyword 'global': global $var; ---- Server IP: 194.109.193.119 Probable Submitter: 80.56.58.248 ---- X-Spam-Status: No, hits=3.1 ...
    Dave60atgmaildotcomDave60atgmaildotcom
    Mar 28, 2006 at 5:45 pm
    Mar 31, 2006 at 10:44 am
  • Hi all Isn't there anything we can do about these massive amount of spam on function.mysql-list-tables & function.swfgradient.addentry? I think I speak for us all when I say its getting quite ...
    Hannes MagnussonHannes Magnusson
    Mar 22, 2006 at 9:20 pm
    Mar 26, 2006 at 4:15 pm
  • Here are some tips on getting the instant client to work with php: I am using Fedora Core 3 and php-5.1.2 on x86. Install: oracle-instantclient-basic-10.xxxx.i386.rpm ...
    DfischerDfischer
    Mar 3, 2006 at 12:56 am
    Dec 7, 2009 at 9:34 pm
  • // This functions calculates the next date only using business days // 2 parameters, the startdate and the number of businessdays to add function calcduedate($datecalc,$duedays) { $i = 1; while ($i ...
    Cas_at_nuy_dot_infoCas_at_nuy_dot_info
    Mar 4, 2006 at 1:43 pm
    Oct 22, 2013 at 2:55 pm
  • To install this in gentoo linux you will need to do some weird stuff: - Make sure you have this use flags set: "dba cli pcre xml zlib oci8-instant-client" - Unmask PHP (5.1.1) by placing ...
    SoefattjahdotnetSoefattjahdotnet
    Mar 3, 2006 at 8:00 pm
    Jun 26, 2009 at 6:31 pm
  • my throw at associative shuffle: $keys = array_keys($arr); $seed = (float)microtime() * 1000000; srand($seed); shuffle($keys); srand($seed); shuffle($arr); $arr = array_combine($keys, $arr); ---- ...
    Php-generalPhp-general
    Mar 8, 2006 at 12:16 am
    Jul 25, 2008 at 5:40 pm
  • In my case, returns 1 if given date is true and nothing if given date is wrong. Knows if there is a 29th february in given year. Very useful!! ---- Server IP: 212.124.37.9 Probable Submitter: ...
    FroeschliFroeschli
    Mar 2, 2006 at 10:32 am
    Apr 18, 2008 at 4:19 pm
  • Apache 1.3, Oracle 9.2, PHP 5.1.2 on Windows XP Pro. Very weird behavior with php_oci8.dll coming with the full windows build (I downloaded yesterday...). Couldn't get any of the examples to work, it ...
    JdstilJdstil
    Mar 18, 2006 at 10:58 pm
    Apr 14, 2008 at 5:32 pm
  • Inspired by the query-string cleaner from greenthumb at 4point-webdesign dot com and istvan dot csiszar at weblab dot hu. This little bit of code cleans up any "style" attributes in your tags, ...
    Grahamdawsongraham_at_imdanet_dot_comGrahamdawsongraham_at_imdanet_dot_com
    Mar 7, 2006 at 9:28 am
    Jun 18, 2007 at 7:51 pm
  • If you want to read a file from your ftp server use this: readfile($username . ":" . $password . "@domain.com/file.html"); Don't use this, it's not going to work: readfile(ftp_get($conn_id, ...
    StefanatstefandoumadotnlStefanatstefandoumadotnl
    Mar 27, 2006 at 11:56 am
    Mar 5, 2007 at 6:33 am
  • RE: www.feisar.de The example posted in the note, as well as the follow up... (posted here for reference) <?php $x1 = '111111111111111111'; $x2 = '111111111111111112'; echo ($x1 == $x2) ? "true\n" : ...
    JustinJustin
    Mar 16, 2006 at 11:52 pm
    Oct 18, 2006 at 4:55 pm
  • Mention specifically that "name" in the descriptions are PHP directives. Also, perhaps include examples in-line the description. Use magic_quotes_gpc and error_reporting as examples. ---- Server IP: ...
    PhilipPhilip
    Mar 31, 2006 at 4:28 pm
    Apr 16, 2006 at 8:19 pm
  • If you want to use readfile for opening a file from your ftp server use this: readfile("ftp://$username:$password@domain.com"); This will not work: readfile(ftp_get($conn_id, $local_file, ...
    StefanatstefandoumadotnlStefanatstefandoumadotnl
    Mar 27, 2006 at 12:10 pm
    Mar 27, 2006 at 2:05 pm
  • The Ninmja sugestion plus multidiomensional array search (recursive): function cleanArray($array) { foreach ($array as $index = $value) { if(is_array($array[$index])) $array[$index] = ...
    AlessandronunesAlessandronunes
    Mar 18, 2006 at 10:01 pm
    May 6, 2014 at 10:04 pm
  • Hello all! I've just been working on a system to automatically manage virtualhosts on an Apache box and I needed to duplicate some multidimensional arrays containing references to other ...
    ElkabongElkabong
    Mar 24, 2006 at 10:26 pm
    May 6, 2014 at 10:00 pm
  • actually, you'd want to MOD the number to get it within a useful range first (1 .. 30). Enjoy. ---- Server IP: 64.71.164.2 Probable Submitter: 206.124.7.47 ---- X-Spam-Status: No, hits=3.1 ...
    SteveneillSteveneill
    Mar 4, 2006 at 12:00 am
    Mar 23, 2014 at 2:16 pm
  • Here's a decent example of the pcntl_waitpid() call: $i = 0; $starttime = microtime(TRUE); $pid_arr = array(); while ($i < intval($argv[1])) { $pid = pcntl_fork(); if ($pid == -1) { die('could not ...
    AdminAdmin
    Mar 6, 2006 at 6:45 pm
    Oct 22, 2013 at 2:58 pm
  • Unicode/multibyte capable 'bin2hex' function, inspired by v0rbiz at yahoo dot com http://www.php.net/manual/en/function.ord.php#42778 function unibin2hex($u) { $k = mb_convert_encoding($u, 'UCS-2LE', ...
    MikeMike
    Mar 14, 2006 at 11:58 pm
    Oct 22, 2013 at 6:53 am
  • Using buzoganylaszlo at yahoo dot com simple nl2p function, I've written a more HTML compliant function to deal with line breaks ... <?php /* FORMATS LINE BREAKS WITH PROPER HTML TAGS */ function ...
    ChaydenChayden
    Mar 10, 2006 at 11:02 pm
    Jun 13, 2013 at 11:11 am
  • Seems like I was a bit too quick and left out the vital part, and I also missed to escape the slashes in the post... <?php function br2nl($text) { return preg_replace('/<br\\\\s*?\\/?? /i', "\\n", ...
    AndersnorrbringAndersnorrbring
    Mar 9, 2006 at 9:45 pm
    Jun 13, 2013 at 11:09 am
  • When read/writing binary files you often cannot rely on the feof() function being of much use, since it doesn't get triggered if the pointer is at the eof but hasn't tried to read one more byte. In ...
    MkamermaMkamerma
    Mar 12, 2006 at 2:08 pm
    Jan 22, 2013 at 12:20 am
  • If you use the PEAR package and prepare() / execute() your queries, you will hardly have to worry about any of this. Of course, it's still a good idea to make sure you're putting valid data in your ...
    Php-generalPhp-general
    Mar 17, 2006 at 5:44 am
    Jan 19, 2013 at 3:43 am
  • Well... hard to explain, why I have written this function, but maybe it will be usefull. <?php // returns the percentage of the string "similarity" function str_compare($str1, $str2) { $count = 0; ...
    Dmitry PolushkinDmitry Polushkin
    Mar 8, 2006 at 4:04 am
    Jan 16, 2013 at 5:28 am
  • To unserialize a PHP session file, unserlize can not be used directly. The data must be split, as the php session file also contains the names of the variables which serialize/unserialize do not do. ...
    EruddErudd
    Mar 30, 2006 at 9:31 pm
    Nov 6, 2012 at 2:10 am
  • I have noticed that using the eval function as described in other posts might produce class redefinitions if separate class files are used and included. My solution was to include_once at the top all ...
    FhummelFhummel
    Mar 2, 2006 at 5:33 am
    Nov 6, 2012 at 1:27 am
  • to thus trying to increment a string and are blocked by the exponential typecast explained in the message below, here is a small function : function increment($var) { $var2 = '_'.$var; return ...
    Julien-bernie-laurentatpolenord ComJulien-bernie-laurentatpolenord Com
    Mar 1, 2006 at 3:52 pm
    Aug 2, 2012 at 3:22 pm
  • WRT Stephen's note: My example of concatenation and array methods of string building does not include the interstitial logic, which is expected to include conditionals. Concatenation method: ...
    CalibanCaliban
    Mar 29, 2006 at 7:05 pm
    Aug 2, 2012 at 3:17 pm
  • I am concerned about this function's generation of [ and ] in the variable names. From what I can gather from http://www.faqs.org/rfcs/rfc3986.html (which I believe to be the most recent RFC on the ...
    ColinguthrieColinguthrie
    Mar 8, 2006 at 3:07 pm
    Aug 2, 2012 at 1:47 pm
  • @ xangelusx You said that "It is actually illegal to set arg_separator.output to &amp; ("and amp ;") as every character is considered a seperator according to the documentation." I don't think this ...
    ColinguthrieColinguthrie
    Mar 8, 2006 at 2:21 pm
    Aug 2, 2012 at 1:36 pm
  • A much easier way to find perfect squares: This method uses integer roots to find perfect squares instead of integer squares to find integer roots. <? # initial value $i = 0; #set any limit you want ...
    Php-generalPhp-general
    Mar 29, 2006 at 7:58 pm
    Feb 16, 2012 at 4:33 pm
  • Here is the smallest chunk of php code describing data structure called stack: <?php class stack{ var $memory=array(); function push($value){ $this- memory[]=$value; } function pop(){ $count=$this- ...
    KrristapsKrristaps
    Mar 16, 2006 at 11:48 am
    Oct 30, 2011 at 6:57 am
  • In some case you need to know how many row are retrieved from a select query (i.e to page a result set) you can use: $totalRows = count($resultSet- fetchAll()); It works on MySQL 5.0.18 and PHP 5.1 ...
    PcdinhPcdinh
    Mar 21, 2006 at 10:35 am
    Jul 18, 2011 at 11:02 pm
  • If you're using PHP < 5, you can use this alternate function, same thing like stripos: <?php if (!function_exists("stripos")) { function stripos($str,$needle) { return ...
    HeavyraptorHeavyraptor
    Mar 21, 2006 at 2:55 pm
    Jun 29, 2011 at 6:57 pm
  • i've just been having fun with the Serializable interface. The big prob is that get_class_vars does not return the current values of the vars, and get_object_vars does not return private members :-( ...
    Me-no-spam-iainMe-no-spam-iain
    Mar 11, 2006 at 2:22 am
    Jun 20, 2011 at 3:23 pm
  • To all you guys out there having problems with mail scripts throwing back this (and you know your scripts are right!!)... Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom ...
    SteveSteve
    Mar 13, 2006 at 4:20 pm
    Jun 20, 2011 at 3:11 pm
  • "SESSION FUNCTION IS DOMAIN SPECIFIC. So, to savage the situation. be domain specific." Umm. No, it isn't. It is however only domain specific when the domains are hosted on the same server. You can ...
    PhpguruPhpguru
    Mar 18, 2006 at 7:53 pm
    Jun 20, 2011 at 3:03 pm
  • If you wish to unset both variables, you will need to unset the last referenced variable of that condition. <?php $a = 1; $b =& $a; unset($b); ? * These must be in a reference- copy hierarchy in ...
    Rustin PharesRustin Phares
    Mar 13, 2006 at 6:27 am
    Apr 20, 2011 at 4:11 pm
  • Oops, that was a question. I'll change it to a note simply: Note: This is NOT enabled at all in the Win32 builds. Best regards ---- Server IP: 193.27.201.10 (proxied: 193.27.201.10 1.0 ...
    JohnringJohnring
    Mar 22, 2006 at 7:49 am
    Jan 26, 2011 at 2:19 pm
  • Constructing an absolute URL (for redirecting or other purposes) is full of pitfalls. As well as considering the notes at http://www.php.net/manual/en/function.header.php#63006 and ...
    Nick BNick B
    Mar 23, 2006 at 2:52 am
    Jan 23, 2011 at 5:26 pm
  • If you have a multi-dimensional array and wish to remove duplicates from a particular "column" as well as the corresponding values in the other "columns", you might find the following helpful. <?php ...
    Brettz9Brettz9
    Mar 9, 2006 at 8:47 am
    Jan 23, 2011 at 5:14 pm
  • In addition to the note that "Parsing an ini file stops at a key named 'none'". Values of 'none' do not return as the string 'none'. They return nothing at all, however this does not halt the ...
    SamSam
    Mar 24, 2006 at 4:22 am
    Jan 23, 2011 at 5:03 pm
  • Here is my PHP5 Singleton only ("no getInstances()") <?php #file class.singleton.php class singleton { var $instance; function __construct() { static $instances=array(); $class = get_class($this); ...
    Contact_usContact_us
    Mar 19, 2006 at 2:23 am
    Jan 23, 2011 at 4:35 pm
  • I am use this script to hidding PHP: index.php -------------- <?php // PARSING QUERY STRING $QS=explode("&",$_SERVER['QUERY_STRING']); $QS=explode('/',$QS[0]); // IF Modul is Undefined set it to ...
    AhmadAhmad
    Mar 6, 2006 at 6:01 am
    Dec 28, 2010 at 12:54 am
  • mysql AES_ENCRYPT() compatibly function for PHP : function mysql_aes_encrypt($val,$ky) { $mode=MCRYPT_MODE_ECB; $enc=MCRYPT_RIJNDAEL_128; $val=str_pad($val, (16*(floor(strlen($val) / ...
    RolfRolf
    Mar 10, 2006 at 8:16 pm
    Dec 13, 2010 at 4:15 pm
  • Re: Ben Laurienti, Disturbing issue with intval() This may make things a little more clear for you: <?php $amount = 19.99 * 100; printf("%.13f", $amount); // Outputs : 1998.99999999999981998 ? ...
    DavidDavid
    Mar 26, 2006 at 4:11 am
    Sep 16, 2010 at 3:06 pm
  • I disagree too with reinoud at hyves dot nl too. It seems youll always get the mysql-error 0 "lost connetion during query" when massive forking at the same time like while x = mysql_fetch_array() - ...
    SpamSpam
    Mar 3, 2006 at 6:49 pm
    Aug 10, 2010 at 3:46 pm
  • to: turigeza on yahoo com You have made a mistake in the function. In it parts: <?php foreach($list as $value) ftp_rmdirr($value, $handle); ? Need: <?php foreach($list as $value) { if ($value != ...
    MvhMvh
    Mar 2, 2006 at 12:58 pm
    Jun 30, 2010 at 12:04 pm
  • Removing a directory using FTP(modified Version): function ftp_rmAll($conn_id,$dst_dir){ $ar_files = ftp_nlist($conn_id, $dst_dir); //var_dump($ar_files); if (is_array($ar_files)){ // makes sure ...
    UmaUma
    Mar 7, 2006 at 12:02 am
    Jun 30, 2010 at 12:03 pm
  • I see many here try to iterate to emulate tis missing functionality. I benchmarked the performance on my PentiumM 1.6G on Excel table with 1100 rows and 2 field records and got 82ms time to retrieve ...
    RomanziakRomanziak
    Mar 22, 2006 at 1:46 pm
    Jun 25, 2010 at 1:43 pm
  • Yes, that's how it is, first you write session_unset, and then the sentence session_distroy ---- Server IP: 201.216.232.3 Probable Submitter: 190.48.129.26 ---- X-Spam-Status: No, hits=3.1 ...
    Php-generalPhp-general
    Mar 7, 2006 at 3:53 pm
    Apr 7, 2010 at 7:08 pm
Group Navigation
period‹ prev | Mar 2006 | next ›
Group Overview
groupphp-notes @
categoriesphp
discussions1,297
posts2,481
users779
websitephp.net

779 users for March 2006

Hannes Magnusson: 468 posts Nuno Lopes: 241 posts Betz: 158 posts Php-general: 142 posts Nathan: 131 posts None: 124 posts Philip: 60 posts None: 56 posts Mazzanet: 53 posts Cece: 43 posts : 36 posts Fill: 21 posts Bill: 16 posts Tomsommer: 11 posts Eric: 11 posts Didou: 9 posts Mike: 9 posts Vincent: 8 posts Poker: 5 posts Tularis: 5 posts
show more
Archives