- Forums
- PHP
- How To Put Or Add Text Data At Beginning Of String PHP Begining Insert
This Page Contains information about How To Put Or Add Text Data At Beginning Of String PHP Begining Insert By edwino85 in category PHP with 0 Replies. [999], Last Updated: Sat May 18, 2024
edwino85
Sun Jan 07, 2007
0 Comments
3740 Visits
the other way i was trying to find a way to add put data at the beginning of a string (letters or numbers in a sentence), today i found the answer.
There is not PHP function I could find, but the answer is very simple.
Let say for example i have a string with the value of "PHP Hosting At Webune.com" this is how the code would look like:
CODE:
<?php
$string = "PHP Hosting At Webune.com";
echo $string;
?>
and this would be the ouput of the php code:
CODE:
PHP Hosting At Webune.com
But, lets say i want to add the word "Free" at the begining of the $string.
well to do that, all i have to do is this:
CODE:
<?php
$string.="Free ";
$string.= "PHP Hosting At Webune.com";
echo $string;
?>
The output would look like this:
CODE:
Free PHP Hosting At Webune.com
Hope this helps. If you want to learn more about PHP, check out our post in this forums, you can learn alot. If you don't have PHP in our site yet, visit our friends at http://www.webune.com to sign up with one of their popular PHP plans.
Wallpaperama Team
Any questions, please replay to this post.