Jump to content
xisto Community
Sign in to follow this  
matak

<?php ?> Marking Up With Php How to simply add HTML tags with PHP

Recommended Posts

Just a simple function to mark your queries :lol:

<?php$uzorak = 'Hosting credit'; //use post to get $uzorak variable$tapeti = "Hosting credits are collected by posting at the forums. The hosting credits are given after your posts are filtered and depending on its size, you get proportional hosting credits. Once you get the required credits you can post an application for hosting. One of our admins will then approve your application after which you can register an account at https://support.xisto.com/ Do not try to spam and collect Hosting credits. Any methods of spamming will not be tolerated. Your Account will be banned if you are caught spamming. After you get hosting, you will have to maintain your hosting credits by staying active. Remember the amount of posts has no effect on Hosting Credits. We look for Quality rather than Quantity.";//use file get contents to get $tapeti variable$tagovi	= array();work	($uzorak, $tapeti);function	work($uzorak, $tapeti)	{$duzina		= strlen($uzorak);$velicina	= strlen($tapeti);$b = array();$a = 0;while	($a <= $velicina){$newstr	=	substr($tapeti, $a, $duzina);if ($newstr == $uzorak){	$tagovi[]= $a;}elseif ($a == $velicina && !empty($tagovi)){	uredi_tagove($tagovi, $tapeti, $duzina);}elseif ($a == $velicina && empty($tagovi)) {	echo "sorry no matches found";	break;}$a++;}}function uredi_tagove($tagovi, $tapeti, $duzina){		$newstring ="";	$count = count($tagovi);	$nextchar = 0;	for($i = 0;$i<$count;$i++)	 {		$newstring .= substr($tapeti,$nextchar,$tagovi[$i]-$nextchar);		$newstring .= "<strong>". substr($tapeti,$tagovi[$i],$duzina) ."</strong>";		$nextchar = $tagovi[$i]+$duzina;	 }	 $newstring .= substr($tapeti,$nextchar);	 print $newstring;}?>

You can see it in action here. Just search for something (note: it might not always work as it's rather simple f-ion) :D

If you want to work with me on a certain project just send me a PM :P
Edited by matak (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.