Skip to content

PHPCodez

Search
  • PHP
  • Magento
  • Javascript
  • HTML
  • My SQL
  • Functions
  • WordPress
  • Plugins
  • Joomla
  • Linux
  • jQuery
  • Profile
  • comments
Linux, PHP

Command to install PHP – Ubuntu Linux

April 30, 2011 Pramod T P Leave a comment

sudo apt-get install php5

LinuxPHPUbuntu
PHP

How to decode the data – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
  $enData	=base64_encode("First");
  echo base64_decode($enData);//First
?>
PHP
PHP

How to encode the data – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
  echo base64_encode("First");
?>
FunctionsPHP
PHP

How to check whether a file exists or not – PHP

April 28, 2011 Pramod T P Leave a comment
<?php

if(file_exists($filePath))
	echo "Exists"

?>
fileFunctionsPHP
PHP

How to delete a file – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 unlink("../".$deleteFilePath) or die("could not delete the file");
?>
filePHP
PHP

How to terminate the current script – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 chmod("../".$image_thumb_path_medium,0777) or die("Could not change permission thumb");
 chmod("../".$image_thumb_path_medium,0777) or exit("Could not change permission thumb");
?>
FunctionsPHP
PHP

Modify the permission of a file/directory – PHP

April 28, 2011 Pramod T P Leave a comment
<?php

chmod("/your_dir/your_file", 0600);
// Read and write for owner, nothing for everybody else

chmod("/your_dir/your_file", 0644);
// Read and write for owner, read for everybody else

chmod("/your_dir/your_file", 0755);
// Everything for owner, read and execute for others

chmod("/your_dir/your_file", 0750);
// Everything for owner, read and execute for owner's group

?>
fileFunctionsPHP
PHP

Remove the first and last item of the array – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 $sampleData = array('10', '20', '30.30', '40', '50');
 array_shift($sampleData);
 array_pop($sampleData);
 print_r($sampleData); // Array ( [0] => 20 [1] => 30.30 [2] => 40 )
?>
PHPString functions
PHP

Remove the first element of an array – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 $sampleDate = array("Test1", "Test2", "Test3", "Test4");
 array_shift($sampleDate);
 print_r($sampleDate); // Array ( [0] => Test2 [1] => Test3 [2] => Test4 ) .
 // Test1 will be shifted
?>
PHPString functions
PHP

Remove the last element of an array – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 $sampleDate = array("Test1", "Test2", "Test3", "Test4");
 array_pop($sampleDate);
 print_r($sampleDate); // Array ( [0] => Test1 [1] => Test2 [2] => Test3 ) .
 // Test4 will be removed
?>
PHPString functions

Posts navigation

← Previous 1 … 96 97 98 … 101 Next →

Beginners' Guide

Recent Posts

  • Upstream sent too big header while reading response
  • Navigate to a Folder from Any Location by Typing a Letter – Linux
  • Magento 2 Admin Content Deployment
  • React vs next JS
  • Disable CAPTCHA Magento 2 Admin Login
  • Difference Between composer.json and composer.lock Files
  • Magento 2 Regenerate URL Rewrites Manually For Categories
  • Magento 2 Regenerate URL Rewrites Manually for Products
  • composer self downgrade

Recent Comments

  • beats solo 4 on allow_url_include
  • Hairstyles on php end of line
  • penipu on cgi.force_redirect
  • lumi777 link alternatif on cgi.force_redirect
  • Beauty Fashion on mysqldump create table if not exists

Categories

  • .htaccess (32)
  • Ajax (4)
  • Apache (43)
  • AWS (11)
  • Cookie (4)
  • Database Model (9)
  • Design Pattern (9)
  • Filter (27)
  • General (187)
  • HTML (5)
  • IP.Board (1)
  • Javascript (99)
  • Jetty (3)
  • Joomla (17)
  • jQuery (63)
  • JSON (3)
  • JSP (1)
  • Linux (125)
  • Magento (371)
  • My SQL (74)
  • nginx (4)
  • OOPs (12)
  • Payment Gateway (1)
  • PHP (1,005)
  • Plugins (11)
  • Prototype (1)
  • session (5)
  • Socialengine (1)
  • SQL (69)
  • SVN (17)
  • Uncategorized (11)
  • Vbulletin (11)
  • Wordpress (89)
Proudly powered by WordPress