FAQ

Search Discussions

243 discussions - 333 posts

  • I used Google-Oauth for authentication, got a "Person-Object" back and saved this in the database (serialized). After unserializing, i got the PHP_INCOMPLETE-Class, because the Person-Class was not ...
    PhpPhp
    Mar 26, 2012 at 11:01 am
    Nov 6, 2012 at 1:39 am
  • join list
    DrakDrak
    Mar 11, 2012 at 5:52 am
    Mar 12, 2012 at 3:19 pm
  • <?php $from ='http://someserver.com/somefile.zip'; $to='./somefile.zip'; i f(!@copy($from,$to)) { $errors= error_get_last(); echo "COPY ERROR: ".$errors['type']; echo "<br / \n".$errors['message']; } ...
    Kashif Rehman ArainKashif Rehman Arain
    Mar 12, 2012 at 10:10 am
    May 10, 2012 at 6:14 pm
  • On two different servers I found that crc32() relates to hash('crc32b',) This may be good to know if you are writing a crc32_file function based on hash_file. (The example does not compensate for ...
    SneskidSneskid
    Mar 14, 2012 at 9:24 pm
    May 10, 2012 at 6:09 pm
  • "apc_mmap: mmap failed: Cannot allocate memory WARNING: Do NOT include a “M” specifier when providing a size for apc.shm_size. Leave it off. It will assume MBs anyways. This solved the issue. ...
    TpTp
    Mar 15, 2012 at 11:17 am
    May 10, 2012 at 6:06 pm
  • Safe redirect: <?php function Redirect($Str_Location, $Bln_Replace = 1, $Int_HRC = NULL) { if(!headers_sent()) { header('location: ' . urldecode($Str_Location), $Bln_Replace, $Int_HRC); exit; } ...
    Yousha AYousha A
    Mar 29, 2012 at 4:29 pm
    Apr 4, 2014 at 11:16 am
  • I've just spent some time battling the "fatal error call to undefined function mysql_connect()" message, and as it wasn't clear to me, I thought it may help to say: php_mysqli does not replace the ...
    IntegraljohnIntegraljohn
    Mar 7, 2012 at 7:36 pm
    Dec 2, 2013 at 9:22 am
  • When you use meta-characters in the regular expression, avoid using them as delimiters. In preference, do not use the meta-characters as delimiters at all. Besides, you must not forget to escape the ...
    AdelbenzartiAdelbenzarti
    Mar 2, 2012 at 11:09 pm
    Oct 22, 2013 at 12:18 pm
  • http://rpmfind.net/linux/RPM/epel/beta/6/x86_64/php-mcrypt-5.3.2-3.el6.x86_64.html installed into RHEL6.2 with no issues, restarted httpd, good to go. ---- Server IP: 64.71.164.2 Probable Submitter ...
    DaveDave
    Mar 22, 2012 at 10:07 pm
    Oct 22, 2013 at 12:17 pm
  • <?php class mysqlisimple extends mysqli { public function __construct($hostname, $username, $password, $database) { $this- connection = @parent::__construct($hostname, $username, $password, ...
    JontehJonteh
    Mar 22, 2012 at 12:00 am
    Jul 24, 2013 at 7:50 pm
  • /*since json_decode() decodes json, it MUST check if the argument passed in is json, so logically one can assume that json_decode() also functions as a json checker*/ //thus.... ...
    AeternuslibertasAeternuslibertas
    Mar 14, 2012 at 6:46 am
    Jun 14, 2013 at 10:04 am
  • If you need to support older versions of PHP be aware that constants such as CRYPT_BLOWFISH may not actually be defined. So rather than following Example #3, you need a defined('CRYPT_...') call ...
    ChrisChris
    Mar 29, 2012 at 9:49 am
    Apr 3, 2013 at 8:56 pm
  • readfile with accurate limit rate, using pv linux command <?php $file = $_SERVER['QUERY_STRING']; header("Content-length: ".filesize($file)); header("Content-type: ".mime_content_type($file)) ...
    Stefano CudiniStefano Cudini
    Mar 30, 2012 at 5:53 pm
    Jan 21, 2013 at 10:01 am
  • I have this little truncate float function function truncate1 ($num, $digits = 0) { $shift = pow(10 , $digits); return ((floor($num * $shift)) / $shift); } I hit a weird floor() behavior problem ...
    ClchuahClchuah
    Mar 24, 2012 at 8:37 am
    Jan 19, 2013 at 3:48 am
  • Taking example from a note above i wanted to spot out the big difference between rand and mt_rand when producing images using randomness as noise. for example this is a comparation between rand and ...
    Cyrax21Cyrax21
    Mar 1, 2012 at 8:44 am
    Jan 17, 2013 at 3:38 pm
  • It should be noted that call_user_func_array('function', array(&$a)); is effectively a call-time pass by reference it should also be noted that it does not throw any error or warning in any version ...
    Bkfake-phpBkfake-php
    Mar 14, 2012 at 5:49 pm
    Jan 15, 2013 at 5:03 am
  • If you get an error like "Warning: Cannot add element to the array as the next element is already occupied" you shouldn't use the array_pop-function. You can use the unset-function instead: echo ...
    Sven UselesspartSven Uselesspart
    Mar 31, 2012 at 9:40 pm
    Dec 17, 2012 at 12:24 pm
  • Here's something uncommon: How to make one else statement for two nested if conditions? aka: how to make one else for two ifs. By default people simply copy & paste code in else like that: <?php if ( ...
    Marcin_wo_wrocMarcin_wo_wroc
    Mar 23, 2012 at 10:26 am
    Oct 10, 2012 at 8:38 pm
  • How to start a session and track it by Pageviews, in this example, if there arent any pageviews, we will get 1. <?php session_start(); if(isset($_SESSION['views'])) { ...
    IdandanielsIdandaniels
    Mar 5, 2012 at 7:00 am
    Sep 28, 2012 at 9:36 am
  • or you can use the sledgehammer approach to get rid of everything betwean any tags: preg_replace ( "'<[^ ]+ 'U", "", $textstring); ---- Server IP: 69.147.83.197 Probable Submitter: 212.62.5.158 ---- ...
    GarrygriersonGarrygrierson
    Mar 29, 2012 at 11:09 am
    Sep 20, 2012 at 12:16 pm
  • PHP5.2.17 for Apache 2.2. The automatic Windows installer did not configure PHP correctly in httpd.conf. It left off the path to the module and PHPIniDir was blank. Adding the path got my ...
    SnarkitSnarkit
    Mar 7, 2012 at 3:06 pm
    Sep 13, 2012 at 9:52 am
  • using on mac with MAMP $a=mktime(0,0,0,07,01,2012); echo date('Y-m-d',$a); // 2012-07-01 $a=mktime(0,0,0,08,01,2012); echo date('Y-m-d',$a); // 2011-12-01 WTF $a=mktime(0,0,0,09,01,2012); echo ...
    TothpeterTothpeter
    Mar 20, 2012 at 1:52 pm
    Sep 7, 2012 at 1:36 am
  • Please note, that somehow MongoDB will throw an Exception if you try to connect to a string like mongodb://A,B,C and one of the repsets is in revover mode: _id" : 0, "name" : "A:27017", "health" : 1, ...
    Sonic1000Sonic1000
    Mar 8, 2012 at 3:46 pm
    Sep 2, 2012 at 12:17 pm
  • The final version of function to check the actual float value based on previous Kenaniah's version. <?php public function isTrueFloat($val){ if( is_float($val) || ( (float) $val (int) $val || ...
    IrcadhikariIrcadhikari
    Mar 14, 2012 at 6:22 pm
    Aug 23, 2012 at 12:07 pm
  • This is funny function for write upside down: <?php function strflip($text) { $text=strrev($text); $text=strtolower($text); $arr = array( "a" = "&#x250;", "b" = "q", "c" = "&#x254;", "d" = "p", "e" = ...
    DyaskurDyaskur
    Mar 27, 2012 at 11:09 pm
    Aug 2, 2012 at 11:28 am
  • ob_start(); include 'passwords.php'; ob_end_clean(); This is a GOLDEN RULE!! ---- Server IP: 69.147.83.197 Probable Submitter: 78.84.118.165 ---- Manual Page -- ...
    KkreivenKkreiven
    Mar 23, 2012 at 8:59 am
    Aug 1, 2012 at 6:51 am
  • This might be obvious to other people but it took me a long time to figure it out; $length takes precedence over $preserve_keys An example: <?php $array = array(1, 2, 3, 4, 5); $slice = ...
    Masta HacksMasta Hacks
    Mar 29, 2012 at 8:54 pm
    Jul 27, 2012 at 4:41 pm
  • In dynamic queries using a variable in the query before defining it will result in the query run with wrong results: consider: $query = "SELECT emp_no FROM employees WHERE dpt_no = '$var'"; $var= ...
    GhighiawGhighiaw
    Mar 28, 2012 at 3:11 am
    Jun 26, 2012 at 12:28 pm
  • This function works good for me example : $pass = "Hello123"; $number = rand(163245,978534); $salt = crypto($pass,$number); function crypto($p) { $number = rand(163245,978534); $pass = ...
    NsbidonNsbidon
    Mar 22, 2012 at 4:03 am
    May 19, 2012 at 8:35 pm
  • In my tests the embeeded server was only able to handle one request at a time. Builds a queue though, so for loading a web page it works. So it is really only usable for very simple test cases. ---- ...
    GaylordGaylord
    Mar 14, 2012 at 3:47 pm
    May 15, 2012 at 12:53 am
  • About CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE, and which / how to use. - CURLOPT_COOKIEJAR is used when cURL is reading cookie data from disk. - CURLOPT_COOKIEFILE is used when cURL is writing the ...
    DotpointerDotpointer
    Mar 1, 2012 at 8:48 am
    May 10, 2012 at 6:43 pm
  • Hey please give me a solution for following problem.... ( ! ) Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. f10sm2244844pbn.58 in ...
    Patil Sanchit50Patil Sanchit50
    Mar 1, 2012 at 2:50 pm
    May 10, 2012 at 6:32 pm
  • You and this function saved my day. Thank you! ---- Server IP: 69.147.83.197 Probable Submitter: 194.95.140.247 ---- Manual Page -- http://www.php.net/manual/en/function.json-decode.php Edit -- ...
    HalloHallo
    Mar 1, 2012 at 2:54 pm
    May 10, 2012 at 6:32 pm
  • Hi Guys I got a multidimensional array coming from a database and automatically wanted to push that into a mysql database with all the data and also if possible with realations if the array gets ...
    A GoergensA Goergens
    Mar 1, 2012 at 5:49 pm
    May 10, 2012 at 6:31 pm
  • Hi, I'm a newbie. I've a problem with opencart google product feed. I get this error in Internet explorer when opening feed.php: Riferimento all'entità non definita "rsquo" that in english i think it ...
    Natura2003-4Natura2003-4
    Mar 2, 2012 at 7:17 am
    May 10, 2012 at 6:30 pm
  • function gmstrtotime($time, $now = null){ static $utc_offset = null; if ($utc_offset === null){ $utc_offset = date_offset_get(new DateTime); } if ($now === null){ $loctime = strtotime($time); } else ...
    VsyrovatVsyrovat
    Mar 3, 2012 at 7:36 am
    May 10, 2012 at 6:29 pm
  • About memo MS Access for get data from memo field of MS Access correctly i add SQL_CUR_USE_ODBC parametr in odbc_connect. and with this parametr I don't use odbc_longreadlen and odbc_binmode. <?php ...
    BunakovmBunakovm
    Mar 4, 2012 at 1:28 pm
    May 10, 2012 at 6:28 pm
  • RU Какой смысл в этой функции? Ведь можно же и обычным query выбрать 1 строку или 1 ячейку. Почему тогда ...
    TruepasswordTruepassword
    Mar 5, 2012 at 6:38 am
    May 10, 2012 at 6:27 pm
  • Hi @kaahzix: In order for your function getBrowser() to check Chrome properly, the preg_match() for Chrome has to come before the preg_match() for Safari. Otherwise Chrome is detected as Safarai ...
    BondhalheyBondhalhey
    Mar 8, 2012 at 12:36 am
    May 10, 2012 at 6:17 pm
  • Hello! I'm using XAMPP 1.7.7 having PHP 5.3.8 and GD 2.0.34 where JPEG Support is enabled. After using the following code to create an image, some errors are displaying every time I refresh the page. ...
    Access RatnajitAccess Ratnajit
    Mar 8, 2012 at 6:46 am
    May 10, 2012 at 6:17 pm
  • Having tried all the suggestions above I had no joy (with attempting to sniff for the existence of an empty table). The method I found to work is: $sql = "select count(*) from " . STATUS_TABLE . ";"; ...
    JdhockadJdhockad
    Mar 8, 2012 at 12:07 pm
    May 10, 2012 at 6:17 pm
  • Are there ways I can access directory(folders) in my computer, using a PHP coding, just as the directory function is used in accessing folders uploaded to the site.... Need help please... ---- Server ...
    UprikingsUprikings
    Mar 9, 2012 at 2:28 am
    May 10, 2012 at 6:16 pm
  • I have this argument in my php file on line 8. require_once(dirname(__FILE__) . '/../../config.php'); but always get an error: Warning: ...
    Bingo Facebook SvenBingo Facebook Sven
    Mar 9, 2012 at 7:26 am
    May 10, 2012 at 6:16 pm
  • @andrejsstepanovs at gmail dot com: You should just use PHP's built-in error suppression; that's exactly the kind of situation it's there for: $str = @sprintf('%s %s %s', 'too few parameters'); ---- ...
    EslindseyEslindsey
    Mar 10, 2012 at 6:49 am
    May 10, 2012 at 6:16 pm
  • To add to the sagacious comment from anonymous at #107788, the $_SESSION array should be immutable until after session_start() has been executed successfully. But it is not. PHP will silently allow ...
    Ray PaseurRay Paseur
    Mar 12, 2012 at 1:07 pm
    May 10, 2012 at 6:14 pm
  • @qeremy Actually you could just add the encoding you desire, and it would work perfectly (i.e: Give the same results as your approach) <?php $str = "Büyük"; print mb_substr($str, 0, 3); //Bü print ...
    Santiago-phpSantiago-php
    Mar 12, 2012 at 8:57 pm
    May 10, 2012 at 6:13 pm
  • It took me a while, but I was able to make a pretty consolidated install procedure for PHP apps on IIS 7. This also sets the IIS application pool identity for connection purposes to a domain user. ...
    KeithKeith
    Mar 12, 2012 at 11:02 pm
    May 10, 2012 at 6:13 pm
  • lecture of data type not perfect but i love it :) ---- Server IP: 116.126.142.157 Probable Submitter: 110.15.244.194 ---- Manual Page -- http://www.php.net/manual/en/language.types.intro.php Edit -- ...
    Dragond7Dragond7
    Mar 13, 2012 at 1:42 pm
    May 10, 2012 at 6:12 pm
  • If your __autoload implementation is not working... Check if spl_autoload_register() is being called before __autoload. PHP 5.3 and PHP 5.4 will completely ignore __autoload. It happened to me after ...
    Juan Carlos MontillaJuan Carlos Montilla
    Mar 14, 2012 at 12:45 am
    May 10, 2012 at 6:11 pm
  • <?php $sql = 'SELECT * FROM users WHERE point< :point'; $sth = $this- db- prepare($sql); /* Bindparam to point */ $sth- execute(Array(':point' = 20)); $data = $sth- fetchAll(); /* Get the number of ...
    NuggezNuggez
    Mar 14, 2012 at 7:53 am
    May 10, 2012 at 6:10 pm
Group Navigation
period‹ prev | Mar 2012 | next ›
Group Overview
groupphp-notes @
categoriesphp
discussions243
posts333
users220
websitephp.net

220 users for March 2012

: 163 posts Daniel Brown: 45 posts Salathe: 17 posts Drak: 15 posts Sp: 8 posts Sneskid: 8 posts Gjarrige: 6 posts Drak: 3 posts Philip Olson: 3 posts Qfox: 2 posts Kriscraig: 2 posts Drpain: 2 posts Bieber: 2 posts Thedoc8786: 2 posts N: 2 posts Bkfake-php: 2 posts Lee8oi: 2 posts Davide Renzi: 2 posts Holdoffhunger: 2 posts Chris: 2 posts
show more
Archives