Have you ever came across a situation where you need to truncate the large text and show the "read more.." link to redirect user to read the full post ?
I know you might be searching for a function to show read more link in php.
Here is our simple function which can be used to show the "Read more.." links dynamically.
The above function can be used anywhere to show read more links with dynamic mysql queries.
How to use this function ???
Here is a simple example to do this
First you will need to create the connection with the database.
Connection settings are stored in "connect.php" file
This will output your article text with proper linking to original post with read more link.
Even you can customize the truncate function for more security check and customizing your display.
Share with friends if you liked it.
Followers
Blogs I read
-
MAKNYOSS8 years ago
-
Sistem Pernapasan Pada Manusia9 years ago
-
Categories
- php (32)
- php functions (9)
- Introduction (8)
- html (8)
- css (6)
- javascript (6)
- MySQL (2)
- firefox (2)
- php bugs-errors (2)
- php interview questions (2)
- MySQL functions (1)
So you installed WampServer on Windows.
Save the file to the directory mytest as index.php
Now click on the icon present in the right hand side of your taskbar and then click on localhost
Now you will see the list of projects, then click on mytest, you can see that your program is executed.
It will show you all the details of the php version you have installed.
Many of us use windows operating system and want to know how to use php on Windows operating system ?
For this there is a very simple and useful solution. Even you don't have to setup & configure many things.
Following things are required for using php on windows
- Apache Server
- Mysql
- PHP
Hi Friends, programming-in-php.blogspot.com is a place to share experience and knowledge.
At many places we require the contact us or feedback form to get some input from the user or to get some feedback from the user.
Today i will be showing you how to create a very simple feedback form or contact us form in php with the mail function and without any database.
1) First we will be creating a simple form to accept the user input like name, email and their message or feedback or query.
2) In the form tag we have not specified any action part and we kept action="" in the form tag, so when the form is submitted at that time it will call itself.
So on submit we will execute our code to send the mail.
sometimes it is required to get the current working directory of the script.
so to get the current working directory in php this is a small function.