PHP unserialize function is use to convert an array string to an array.
But if the string not in proper array string it will return Notice error like below:
Notice: unserialize() [function.unserialize]: Error at offset 0 of 6 bytes
The easy way to fix this problem is write a function and call it “is_serialized”, use to check the string before unserialize it.
Posted by
chevrons in
PHP
In Yii
CGridView it doesn’t provide absolute row number in all the pages.
The easy way is write the a calculation method inside the column to show the column number.
Posted by
chevrons in
Yii
Normally in Yii model rules validation to set the error message like below:
array('username', 'required', 'message'=>'username cannot blank.');
But,
numerical validate method is different if you set the ‘
min‘ or ‘
max‘ inside the rules.
Posted by
chevrons in
Yii
I face a weird problem in PHP. I just upgrade to php 5.3.0 and since the upgrade I’m getting the following warning:
Warning: getdate() [function.getdate]: It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.
And date.timezone also added. But the warning still there.
Posted by
chevrons in
PHP