I’m using this regular expression to test if a username is valid: [A-Za-z0-9 _]{3,12} when I test it for matches in a text editor with the string test’ing, it highlights ‘test’ and ‘ing’, but when I use the following code in PHP: if(!preg_match(‘/[A-Za-z0-9 _]{3,12}/&…
Tag: php
phpexcel freeze row and columns
I’m trying to freeze the top row and the first 3 columns in a worksheet, using PHPExcel. I can freeze the row without any problem: $objPHPExcel->getActiveSheet()->freezePane(‘A2’); Or I can …
How to change the database connection in YII
I have yii application,, and i want to change the database connection.. first, my app is connect to ‘trackstar’ database, and later i want to change to ‘taskmanagement’ database.. So i just simply change the dbname in my code : but when i run the app i got error : CDbCommand failed to …
PHP ignoring curl.cainfo setting in php.ini (apparently)
I’m trying to fix a php_curl call on a Windows server (running IIS) that is returning the familiar error “SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed”. As detailed in many related questions…
Laravel blade – Add a class if a condition is met
This is simple but I can’t seem to be able to do it with blade and I usually go back to php for this but, since I can’t declare a new php variable with blade (without printing it, that is) how should …
Using getlementbyclass name or getlementbytag to scrape data from html content
Here I have taken source code snipper from webpage : http://www.yelp.com/biz/franchino-san-francisco?start=80. I want to scrape date, review, rate for each block on the page. @: http://ideone.com/fork/Yfw2re I am not much familiar with DOM element, I appreciate if someone can correct this Here is the code : A…
How enable_dl configuration in php can be useful?
I was going through php.ini and I have found the following parameter enable_dl with a strange description: This directive is really only useful in the Apache module version of PHP. You can turn dynamic loading of PHP extensions with dl() on and off per virtual server or per directory. The main reason for turn…
How to check if barcode software is installed and run it (or install it) on iPhone iPad iPod?
I am writing a web application that will use barcode scanning software. The process for Android devices is following: I have the element on page: <a href=”intent://scan/?ret=www.mysite.com%2F%7BCODE%7D%2F#Intent;scheme=zxing;package=com.google.zxing.client.android;end”> After click, it is ch…
what is php-common and what does it do?
I am on centos 6.5 and when I install do yum install php-common it goes ahead and installs some packages, but php is still not installed. And, when I want to install php directly it is says php-common …
CodeIgniter – Process Simple XML & PHP
in the controller I have _send method. This method returns something like below: This method called: I am unable to create array or object suitable for passing to model for inserting into DB. Below what I have now. I am attempting to achieve something like this array: Problem with error attribute with fault a…