-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathstring.php
More file actions
56 lines (49 loc) · 1.38 KB
/
Copy pathstring.php
File metadata and controls
56 lines (49 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
//$str = "This Is A Random STRing";
/*$str = str_replace('This Is A Random STRing','This Is A Random String',$str);//Replacing a String in the parent String
echo $str;*/
/*
$sub = substr($str,5,7); // Grab the substring from the parent string
echo $sub;
*/
/*
$str = "<b>My Name is <i>Anwar Ali</i></b>";
//echo $str;
$stripped = strip_tags($str,'<b>'); // Strip out all the HTML tags from the parent string except for the mentioned tags
echo $stripped;
*/
/*
$str = strtoupper($str); // Converts the entire letters of the string to uppercase
echo $str;
*/
/*
$str = strtolower($str); // Converts the entire letters of the string to lowercase
echo $str;
*/
/*
$str = "anwar";
$str = ucfirst($str);// Converts the first letter of the string to uppercase
echo $str;
*/
/*
if(isset($_POST['description']))
{
$desc = $_POST['description'];
echo nl2br($desc); // If you want to covert the new line to <br>
}
?>
<form action="" method="post">
<textarea name="description"></textarea><br>
<input type="submit" value="Submit">
</form>
*/
/*
$str = "Hello, Hi, What's Up, How is it going?";
$arr = explode(',',$str); // separate a string with reference to a character and place them in array
$new_str = implode('_',$arr); // Joing the values of array to a string with reference to a character.
echo $new_str;
*/
/*
$str = ' A b c d ';
echo trim($str);// To remove the unnecessary white spaces
*/