Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)
Paste
Pasted as Plain Text by registered user arbaazssaah ( 6 years ago )
STR_REPLACE()
<?php
$text = "Replacing text";
$replace = str_replace("text","string",$text);
echo $replace;
...........................................................
STRLEN()
<?DOCTYPE html>
<html>
<head>
<title>Length Of A String</title>
</head>
<body>
<form action="" method="post">
<input type="text" name="string"><br>
<input type="submit" name="submit" value="Submit" >
</form>
</body>
</html>
<?php
if(isset($_POST['submit'])){
$string=$_POST['string'];
$reverse=strrev($string);
echo "The Reverse of String is ".$reverse;
}
.....................................................................
STRREV()
<?DOCTYPE html>
<html>
<head>
<title>Length Of A String</title>
</head>
<body>
<form action="" method="post">
<input type="text" name="string"><br>
<input type="submit" name="submit" value="Submit" >
</form>
</body>
</html>
<?php
if(isset($_POST['submit'])){
$string=$_POST['string'];
$length=strlen($string);
echo "The Length is ".$length;
}
.....................................................................................
TRIM()
<?php
$str1="Trim ";
print rtrim($str1);
$str2=" Trim";
print ltrim($str2);
$str3=" Trim ";
print trim($str3);
?>
..........................................................
STRPOS()
<form action="" method="POST">
Text:<br>
<input type="text" id="text" name="text" ><br>
Search:<br>
<input type="text" id="text" name="search" ><br>
<input type="submit" name="submit" value="Submit">
</form>
<?php
if(isset($_POST["submit"]))
{
$text=$_POST['text'];
$search=$_POST['search'];
echo "Position:";
echo strpos("$text","$search");
}
?>
Revise this Paste