Skip to content

PHPCodez

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

Replace string with another string – PHP

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

$name 	=	"Hello Name";

$name =str_replace("Name", "First Name", $name);

echo $name;  // Hello First Name

?>
PHPString functions
PHP

Convert the first character of each word in a string into uppercase – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo ucwords("hello name"); // Hello Name
?>
PHPString functions
PHP

Convert the first letter into lower case – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo lcfirst("Name"); // name
?>
PHPString functions
PHP

Convert the first letter into uppercase – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo ucfirst("name"); //Name
?>
PHPString functions
PHP

Convert the string into upper case – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo strtoupper("name"); // Name
?>
PHPString functions
PHP

Convert the string into lower case – PHP

April 28, 2011 Pramod T P Leave a comment
<?php
 echo strtolower("FIRST NAME") //first name
?>
PHPString functions
PHP

Remove spaces from the beginning and end of a string – PHP

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

echo trim("  Test "); // Test

//Will remove the spaces from the beginning and end
?>
PHPString functions
PHP

How to read all the keys or a subset of the keys of an array – PHP

April 19, 2011 Pramod T P Leave a comment
<?php
 $testArray = array(1 => 5, "name" => "First Name");
 print_r(array_keys($testArray));
 //Array ( [0] => 1 [1] => name )
?>
ArrayPHPString functions
PHP

Check whether a variable is empty – PHP

April 19, 2011 Pramod T P Leave a comment
<?php
 // Example 1
 $string="";
 if(empty($string))
  echo "Empty string";
 else
  echo "Not an empty string"; //Empty string
?>

<?php
 // Example 2
 $strng="Test";
 if(empty($strng))
  echo "Empty string";
 else
  echo "Not an empty string";  //Not an empty string
?>
PHPString functions
PHP

Add backslashes in front of special characters – PHP

April 19, 2011 Pramod T P Leave a comment
<?php
 $str = "Test's";
 echo addslashes($str); //Test's
?>
PHPString functions

Posts navigation

← Previous 1 … 97 98 99 … 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