Tips while working with strings
string concatenation
echo ‘php’, ‘developer’; // saves overhead time for string concatenation.
echo ‘foo’ . ‘bar’; // slower..
Interpolation
$variable = ‘this is ‘.$another_var.’ with me’; // faster
$variable = “this is $another_var with me”; // slower
Tip:
Simply use the single quote instead [...]
Archive for February, 2009
27 Feb
Tips while working with strings
25 Feb
Copy Method in PHP
Php copy method is like below:
bool copy ( string $source , string $dest [, resource $context ] )
It makes a copy of the file from source to dest.
Now in the following example we will see the codes where copy operation is done.
<?php
$dest = “/Folder1″ ;
$source = “/Folder2″;
copyr($source, $dest);
function copyr($source, [...]
Recent Comments