Category Covered

Read xml file on php  

Here is an simple example on how you will read a xml file on php Suppose you have a file named "categories.xml" which may have the following content <?xml version="1.0" encoding="UTF-8"?> <CategoriesRoot> <Categories> <CategoryID>1</CategoryID> <CategoryName>Beverages</CategoryName> <Description>Soft drinks, coffees, teas, beer, and  
By: Tech writer  |   Total Read: 626  |   Read more..

PHP Shorthand If Else condition  

Here is the simple example of php if else conditions   $var = '1'; if ($var == "1") { echo "Yes"; } else { echo "No"; } Here is the ternary example of php if else conditions   echo $output = ($var) ? 'Yes' : 'No';  
By: Tech writer  |   Total Read: 821  |   Read more..

Sub domain in localhost server  

If you want to setup Sub domain in localhost server then this article will help you. Step 1: Edit the file located in C:\windows\system32\drivers\etc\hosts *Before edit the file make sure you take back up of the file. add the following line to it 127.0.0.1 subsite.localhost Save the File Step 2: Edit the httpd.conf file on apache server You need to create virtualhost on localhost Add the following to the bottom of the file NameVirtualHo  
By: Tech writer  |   Total Read: 608  |   Read more..

Call to undefined function simplexml_load_file  

Are you getting the error "Call to undefined function: simplexml_load_file() ?" What version of php are you running? Must have version php 5.
 
In PHP 5 its default enable  
By: Tech writer  |   Total Read: 1226  |   Read more..

How to create dynamic array  

If you have some data or a big sentence then you can make a array with that data. Here is an example on how to create a dynamic array. $source = a,b,v,f,s,d;$allFields = explode(',', $source); $option = array();foreach($allFields as $key => $value): $option[$value] = $value;endforeach; print_r($option);    
By: mimosa  |   Total Read: 604  |   Read more..

cake php mail body missing  

Sometimes this is happed that we made a function for sending mail and mail is also sending but mail body is missing then you can see the following things. If you use any email templates then make sure the spelling is ok Any variable that you use is absulately correct. You can try just giving some demo text without any php or asp code.  
By: Tech writer  |   Total Read: 756  |   Read more..

How to send mail from localhost  

If you get the error like "Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() "
or
If you want to send email from your local server or localhost application then you need to
  Follow the steps:

Sendmail extension needs to be download the from the follwing li  
By: Tech writer  |   Total Read: 2569  |   Read more..

how to remove the last string from a sentence  

If you want to remove the last string from a sentence you can try the following one Please try in this way
substr_replace($string, "", -1) Or you try this by echo rtrim($string, ",");    
By: Tech writer  |   Total Read: 603  |   Read more..

Fatal error Maximum execution time of 30 seconds exceeded  

Fatal error*: Maximum execution time of 30 seconds exceeded? Change your php.ini file and set maximum execution time 30 seconds to 10000 seconds. Thats' it :)  
By: Tech writer  |   Total Read: 1402  |   Read more..

cron job linux  

I have a project on cakephp and there is a function named "myfunction" under "mycontroller". So i want to show you now how to setup cron job on linux environment for a url on cakephp project. For example the url "http://mydomain.com/mycontroller/myaction/myparams" which i want to run through the cron job on linux cpanel. Follow the step: Open your cpanel On left hand side you will see a find box. There  
By: Tech writer  |   Total Read: 2878  |   Read more..
Top 15 Posts
Google+