FAQ

Search Discussions

606 discussions - 890 posts

  • It seems like call_user_func() can not be used to create Objects via the new Command. The Following example dosen't work: <? include_once(class_".$type.".php"); $object = new call_user_func ...
    InfoInfo
    May 18, 2005 at 9:13 pm
    Jul 19, 2008 at 9:03 pm
  • This might be something obvious, but it gave me a lot of headache to find out: If you use an ascii char#0 in the "string mensaje" parameter, it will truncate the message till that point, (this ...
    JavierJavier
    May 31, 2005 at 5:57 pm
    Jun 20, 2011 at 3:11 pm
  • <? /************************************************************ * Author: Richard Lajaunie * Mail : richard.lajaunie@cote-azur.cci.fr * * subject : this script retreive all mac-addresses on all ...
    Richard LajaunieRichard Lajaunie
    May 19, 2005 at 8:28 am
    Jan 23, 2011 at 4:44 pm
  • If you want the change NLS_LANG (e.g.: NLS_LANG="FRENCH_FRANCE.WE8ISO8859P1") don't forget to also set LC_ALL and LANG (e.g.: LC_ALL=french and LANG=french) else you'll have a ORA-01756 when you try ...
    TofTof
    May 18, 2005 at 1:36 pm
    Dec 9, 2009 at 10:13 pm
  • I never found a way to create a new, empty, generic object so I coded something up myself. In addition, let me show you some imperfect examples. <? // Incorrect: $obj1 = (object) ''; $obj2 = (object) ...
    AjgAjg
    May 16, 2005 at 4:46 pm
    Aug 19, 2007 at 11:54 pm
  • A similar function can be achieved in Windows (NTFS) using folder or file junction points. There are 2 free apps for this: -Junction Link Magic for folders http://www.rekenwonder.com/linkmagic.htm ...
    Php-generalPhp-general
    May 11, 2005 at 7:35 pm
    Mar 16, 2006 at 10:41 am
  • In response to Ryan's post with his echobig() function, using str_split wastes memory resources for what you are doing. If all you want to do is echo smaller chunks of a large string, I found the ...
    Jasoncarlson-sitesanityJasoncarlson-sitesanity
    May 16, 2005 at 6:51 pm
    Jan 22, 2014 at 8:55 pm
  • // Convert only <br <br / and <br / to newline function br2nl($str) { return preg_replace('=<br */? =i', "\n", $str); } The Script at the bottom whit '!<br.* !iU' match tags like <break or something. ...
    Sebastianatnospamflashhilfe DeSebastianatnospamflashhilfe De
    May 10, 2005 at 4:28 pm
    Jun 13, 2013 at 11:07 am
  • A note to add to the br2nl. Since nl2br doesn't remove the line breaks when adding in the <br / tags, it is necessary to strip those off before you convert all of the tags, otherwise you will get ...
    KristenKristen
    May 16, 2005 at 9:34 am
    Jun 13, 2013 at 11:07 am
  • cleaner version of shadow() and with more ascii chars <?php function shadow ($input){ for ($n = 0; $n < 9; $n++){ $s .= chr(rand(64,126)); } $seed = "$1$".$s."$"; $return = crypt($input,$seed); ...
    VladalexamancinimancinVladalexamancinimancin
    May 15, 2005 at 10:19 pm
    Apr 3, 2013 at 8:57 pm
  • strrev() can be very useful in cases where it makes more sense to do something from the end of a string rather than the beginning (well duh!) such as apply certain regular expressions. Here's a small ...
    AvarabAvarab
    May 7, 2005 at 9:09 am
    Sep 10, 2012 at 1:24 am
  • this is something you can use if you need an exact answer to a root problem, this includes an echo outside of the function to show how it works, it will return it such as $ret[0] is the number still ...
    Btharper1221Btharper1221
    May 15, 2005 at 5:02 pm
    Aug 2, 2012 at 3:37 pm
  • This is a workaround for PHP versions < PHP5. It does not work with complex arrays, however. <? if (!function_exists('http_build_query')) { function http_build_query($formdata, $numeric_prefix = "") ...
    Php NetPhp Net
    May 12, 2005 at 2:41 pm
    Aug 2, 2012 at 1:36 pm
  • Here is another variation on Chris' function. I added a $skip_empty parameter. if it's set to TRUE the result string will not contain keys whose values are empty. Great for building query_strings. If ...
    KillroyatgmaildotcomKillroyatgmaildotcom
    May 16, 2005 at 9:40 am
    Aug 2, 2012 at 1:16 pm
  • Note that manithu's post on 29-Mar-2005 02:49 for identifying strings that only contain whitespaces will also identify strings like "0" and " 0 " as being empty. If you want to check whether ...
    Dmr37atcornelldoteduDmr37atcornelldotedu
    May 17, 2005 at 9:01 pm
    Aug 2, 2012 at 12:22 pm
  • I will make Screend at hf dot webex dot com's comment more clear and understandable. strrev only works for singlebyte character-sets. Multibytes charactersets are not compatibles with strrev. ...
    MagicaltuxMagicaltux
    May 12, 2005 at 2:41 pm
    Aug 2, 2012 at 11:30 am
  • There is another way to execute a PHP ActiveScript: 1/ In explorer, open menu "Tools/Folder Options" 2/ Go to tab "File Type" 3/ Click on "New" button and enter a file extension ( PHS for my sample ...
    Garfiel_frGarfiel_fr
    May 11, 2005 at 5:24 pm
    Feb 23, 2012 at 10:03 am
  • Tomek Krzeminski's iconv_str_pad modified for php 4 (iconv_strlen only works for php 5) courtesy of www.anloc.net function iconv_str_pad( $input, $pad_length, $pad_string = '', $pad_type = 1, ...
    AnlocAnloc
    May 19, 2005 at 6:51 pm
    Jul 2, 2011 at 6:54 pm
  • Fix for unknown writer of 29-aug-2002. If you need to get a reference to the first or last element of an array, use these functions: function &first(&$array) { if (!is_array($array)) return null; if ...
    Php-generalPhp-general
    May 12, 2005 at 9:37 am
    Jun 15, 2011 at 11:02 pm
  • This post is with regards to handling forms that have more than one submit button. Suppose we have an HTML form with a submit button specified like this: <input type="submit" value="Delete" ...
    KrydprzKrydprz
    May 4, 2005 at 12:15 pm
    Mar 9, 2011 at 2:26 pm
  • Better use a random value for the salt and store it seperate in the database for every user. So it is not possible to see if some users have the same password. ---- Manual Page -- ...
    OguhOguh
    May 11, 2005 at 7:51 pm
    Dec 29, 2010 at 3:15 am
  • I had the same problem with the new Mac OS Tiger Server. Refer to http://dev.mysql.com/doc/mysql/en/old-client.html Worked for me. ---- Manual Page -- http://www.php.net/manual/en/ref.mysql.php Edit ...
    ChadChad
    May 7, 2005 at 4:08 am
    Apr 7, 2010 at 4:47 pm
  • little counter with rewind() http://www.michael-berndt.de/ie/tux/counter.htm ---- Manual Page -- http://www.php.net/manual/en/function.rewind.php Edit -- ...
    BerndtBerndt
    May 5, 2005 at 8:49 am
    Apr 7, 2010 at 2:39 pm
  • About the note of ccblanket at yahoo dot com... Nice tip, but on line 2 of your example we need to use $ldapSortAttributes and not $ldapSortAttribues :-) So, the whole correct function is: <?php ...
    HuntzHuntz
    May 17, 2005 at 5:17 pm
    Mar 31, 2010 at 4:02 pm
  • Several people have suggested using str_replace instead of strtr... Here is why that will not always work.... <? $string = "This is a BIG test with SMALL RESULT\n"; $repl = array('BIG' = 'SMALL', ...
    JaykJayk
    May 4, 2005 at 12:20 pm
    Mar 4, 2010 at 6:05 pm
  • i had some problems whith encode-decode russian-cp1251 strings into utf8, like browser do "this" in url... (my Apache runs under windows and some local files have russian names - it needs to create ...
    DenjsDenjs
    May 11, 2005 at 2:21 am
    Feb 18, 2010 at 2:22 pm
  • Sometimes, ob_get_level() may be off by 1 because at the start of the script, it will return 1 even if ob_start() has never been called (and clearing the output buffer via ob_end_clean() and the like ...
    Php-generalPhp-general
    May 18, 2005 at 5:07 pm
    Feb 4, 2010 at 8:51 pm
  • References don't seem to work correctly with objects. I don't seem to be able to nest objects such that each child has a reference to it's parent. The below seems to not work. class tree { var ...
    MogmiosMogmios
    May 11, 2005 at 6:43 pm
    Jan 28, 2010 at 1:05 pm
  • This will save you time if you're building a class hierarchy with 2 or more levels of inheritance. $this always refers to the CURRENT INSTANCE. Therefore if you have: class A{ function A(){ } // .... ...
    JfonsecaJfonseca
    May 19, 2005 at 3:29 am
    Nov 7, 2009 at 6:45 pm
  • As has been already commented, opening multiple connection handles with: <?php $connection_handle = mysql_connect($hostname_and_port,$user,$password); ? causes the connection ID/handle to be REUSED ...
    BuzzBuzz
    May 6, 2005 at 2:24 pm
    Jun 17, 2009 at 2:38 pm
  • i wrote a small case study to compare is_null / == NULL / === NULL Here's the code :: <?php $Array = array ( 0 , '' , FALSE , NULL ) ; $ArrayCount = count ( $Array ) ; $String .= '$Array = ' . "array ...
    DisappearDisappear
    May 9, 2005 at 5:00 am
    Jun 15, 2009 at 12:15 pm
  • In reply to "pflaume dot NOSPAM at NOSPAM dot gmx dot de" about fopen() and PROXY With PHP 5.0.0 and after, you can use a proxy by using a stream context. See the note about "Context support was ...
    FrancoisatcrevoladotcomFrancoisatcrevoladotcom
    May 11, 2005 at 1:15 pm
    Jun 8, 2009 at 11:35 pm
  • Further to my previous post this may prove to be more efficient by eliminating the need for array_flip() on each iteration. $distinct_words = array(); foreach ($article as $word) { if ...
    GregGreg
    May 17, 2005 at 1:55 pm
    Jun 8, 2009 at 9:40 pm
  • in_array() doesn't seem to scale very well when the array you are searching becomes large. I often need to use in_array() when building an array of distinct values. The code below seems to scale ...
    GregGreg
    May 13, 2005 at 4:05 pm
    Jun 8, 2009 at 9:40 pm
  • Hi, Im using PHP 5.0.3 i wrote a small null study to test the cases here and this is the results i got Code :: <?php $Array = array ( 0 , '' , FALSE , NULL ) ; $ArrayCount = count ( $Array ) ; ...
    DisappearDisappear
    May 2, 2005 at 11:18 am
    May 19, 2009 at 2:16 pm
  • Another method to parse an XML Document into a PHP array with SIMPLEXML inspired from Daniel FAIVRE ! function xml2php($xml) { $fils = 0; $tab = false; $array = array(); foreach($xml- children() as ...
    Tchassagnettet_chassagnetteTchassagnettet_chassagnette
    May 4, 2005 at 11:44 am
    May 18, 2009 at 1:23 am
  • Hi, If you want to access an element that has a dash in its name, (as is common with the XML documents provided by the Library of Congress, as well as the NWS) you will need to handle it a little bit ...
    PaulPaul
    May 6, 2005 at 1:36 pm
    May 18, 2009 at 1:23 am
  • As stated above, when using return() to terminate execution of an included file, any functions defined in the file will still be defined in the global scope, even if the return() occurs before their ...
    PhpPhp
    May 3, 2005 at 1:18 am
    May 18, 2009 at 1:00 am
  • Thought you can figure it out by reading the doc, this hint might save you some time. If you override include_path, be sure to include the current directory ( . ) in the path list, otherwise ...
    Php-generalPhp-general
    May 17, 2005 at 4:25 pm
    May 18, 2009 at 1:00 am
  • About CURLOPT_ENCODING: added in curl in 7.10 - Oct 1 2002 In 7.10.5 - May 19 2003 syntax was chnaged: "setting CURLOPT_ENCODING to "" automaticly enables all supported encodings" ---- Manual Page -- ...
    SamlowrySamlowry
    May 14, 2005 at 2:13 pm
    May 17, 2009 at 7:34 pm
  • Yet-another-wordwrap-improvement... If you attempt to wordwrap() lines that already contain some line-breaks that you want to maintain, a simple wrapper around wordwrap can help. For example: ...
    KyleKyle
    May 31, 2005 at 10:37 pm
    May 17, 2009 at 6:30 pm
  • Dave Meiners above example is great, except that you need to need to add one to the final length to account for EOL. So it'd be: while ($data = fgetcsv($handle, ($length+1), ",")) ---- Manual Page -- ...
    BobkolkBobkolk
    May 17, 2005 at 6:06 pm
    May 17, 2009 at 6:12 pm
  • I don't know if in PHP 5+ this problem is solved, but, when I send via POST using CURLOPT_POSTFIELDS some times it doesnt work an associative array as parameter... and, if I need to send non-ascii ...
    AleatdesarrolloweburuguaydotcomAleatdesarrolloweburuguaydotcom
    May 5, 2005 at 1:22 pm
    May 17, 2009 at 5:27 pm
  • Using cURL, I needed to call a third-party script which was returning binary data as attachment to pass on retrieved data again as attachment. Problem was that the third-party script occassionally ...
    IkendraatykendotnospamdotorgIkendraatykendotnospamdotorg
    May 9, 2005 at 5:32 pm
    May 17, 2009 at 5:27 pm
  • The bankers' rounding behaviour mentioned in the notes below seems to have been changed to normaly rounding. From the comments in http://bugs.php.net/bug.php?id=24142 it was changed in 4.3.0 but ...
    Twain47Twain47
    May 10, 2005 at 3:33 pm
    May 17, 2009 at 4:18 pm
  • another WARNING about report #26396 having status "wont fix": Beware of using foreach in recursive functions like... function sort_folders(&$items, $parent,$level) { foreach($items as $item) { ...
    BadbrushBadbrush
    May 15, 2005 at 6:41 pm
    Apr 28, 2009 at 1:06 pm
  • I had the same problem with foreach() and a recursiv function. If you don't want to spend about 1 or 2 hours to solve this problem, just use for() loops instead of foreach(). Some Example: $arr[] = ...
    PaulchateauPaulchateau
    May 17, 2005 at 7:14 am
    Apr 28, 2009 at 1:06 pm
  • In the code of gordon at kanazawa-gu dot ac dot jp, long subjects become corrupted when using utf-8 encoding because of the length parameter. The following version works even with utf-8: <?php // ... ...
    DanielDaniel
    May 1, 2005 at 3:04 pm
    Apr 25, 2009 at 3:01 pm
  • Two additions to my previous note: 1. You can of course *always* run a DoS on any server at any time. If you have a few hundred hijacked machines, then you can incapacitate even huge sites like ...
    TommiboyTommiboy
    May 11, 2005 at 12:51 pm
    Mar 14, 2009 at 2:36 pm
  • Using sleep() to slow down intruders is a very bad idea since it keeps your httpd running. If someone realizes that you are using sleep(), then he can very easily run a DoS on your server. All he ...
    TommiboyTommiboy
    May 5, 2005 at 4:21 pm
    Mar 14, 2009 at 2:36 pm
Group Navigation
period‹ prev | May 2005 | next ›
Group Overview
groupphp-notes @
categoriesphp
discussions606
posts890
users458
websitephp.net

458 users for May 2005

Nlopess: 194 posts Php-general: 60 posts Tularis: 29 posts Betz: 29 posts Didou: 22 posts Derek: 18 posts : 18 posts Berndt: 10 posts Aidan: 9 posts Phpdoc: 5 posts Tobias_demuth: 4 posts Tommiboy: 4 posts Robertchapin: 4 posts C_cyrus: 3 posts Jenefarm: 3 posts Vrana: 3 posts Michaelt Mcgrew: 3 posts T0russ: 3 posts Jm: 3 posts Cece: 3 posts
show more
Archives