Sometimes we need to decode HTML entities from any specific strings in PHP. Basically it’s more used for retrieve HTML entities from a MySQL cell.? To Convert all HTML entities to their applicable characters there is one function available that is called html_entity_decode().
$orig?=?"I'll?"love"?the?<b>girl</b> very much";
echo?$a;?//?I'll?"love"?the?<b>girl</b> very much
echo?$b;?//?I'll?"love"?the?<b>girl</b> very much?>
When you will work with your Blog or something in PHP, MySQL. Then your user may enter apostrophe s (‘s) into the post writing area. Then it will cause a problem for executing your MySQL Query. To execute your query for MySQL you can use mysql_real_escape_string($yourStrings).
<form method=”post” action=””>
<input type=”text” name=”user_name” value=”wallpaperama’s”>
<input type=”submit” name=”Submit” value=”Submit”>
$user_name = mysql_real_escape_string ($_POST[‘user_name’]);
and write your mysql query. It will be executed without any error. It’s more secured to post data to MySQL database.
For know more details please go to mysql_real_escape_string() in PHP Function Manual.
Sometimes when you make many functions in your PHP scripts. Then you need to check the real existence of the function you need. That’s why to check a function’s existence, you can write a little piece of code like the following:
<span style="font-family: monospace;">}</span>
echo "Function doesn't exist";
NameOfTheFunction means your function's name. If your function is LoginCheck(). Then you need to write only LoginCheck. Just omitt the () symbol.
If it is helpful for you please make comments and share it.
To write values or text in a .txt file you can follow the following process in PHP.
function test_function ()
$function_contents = test_function ();
$file_name = "test_file.txt";
$file_handle = fopen($file_name, 'w');
It will make a text file named test_file.txt and in that file this PHP code snippet will write ‘Hello’.
Still finding some solution or idea that can be useful for online campaign management for any small company. I am still finding for my own company.
May be I will go forward to build this system myself. But it’s new to me. Need idea. I am searching for the solution and gathering experience to make that more professional.