- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
7 Posted Topics
Here's a function I'm using right now: [code=PHP] function hl($c,$q){ $q=explode(' ',str_replace(array('','\','+','*','?','[','^',']','$','(',')','{','}','=','!','<','>','|',':','#','-','_'),'',$q)); for($i=0;$i<sizeOf($q);$i++) $c=preg_replace("/($q[$i])(?![^<]*>)/i","<b>\${1}</b>",$c); return $c; } [/code] But if you don't have HTML tags in your content you could use a faster function: [code=PHP] function hl($c,$q){ $q=explode(' ',$q); for($i=0;$i<sizeOf($q);$i++) $c=preg_replace("/($q[$i])/i","<b>\${1}</b>",$c); return $c; } [/code] $content="Simple content. Try it!"; $query="simple …
3-4 days ago I registered nameservers and created A records for ns1.altprice.com & ns2.altprice.com, going to [url]http://ns1.altprice.com[/url] will show my server's msg - meaning server works fine. Problem is when I assign those nameservers to another domain, e.g.: altprices.com - the domain won't load or resolve to the server, and …
May I ask related question in here? I was just reading around, found this thread and remembered that I always wanted to know if it's possible to query database only once, at first visit, to confirm login/pwd is correct. Basicaly, is there a way to let user browse protected area …
Run this...: [CODE=PHP] <?php function recrusion($array, $return, $pid=0, $level=0) { foreach($array as $id=>$parent) { if( $parent===$pid ) { $return[$id]= $level; /* remove "unset" for correct results */ unset($array[$id]); recrusion(&$array, &$return, $id, $level+1); } } } /* input array as id=>parent */ $array= array(1=>0,2=>1,3=>2,4=>3,5=>2,6=>2,7=>6,8=>6,9=>0,10=>0); $return= array(); recrusion($array, &$return); /* return array …
I wasn't sure where to put this topic, web or software development... The questions is this: is there a way to build a website with C? (not PHP calling C application) I read the web for a couple of days now, but I can't really find any explanation how to …
Hello everybody, Yesterday I finished testing a new CMS I developed for a while, and now I'd like to ask for your help. Could you please help test this system under different PHP version/settings? The system works on a flat file database class I wrote, so no database setup or …
There's another way to do it, pure css. Try this: [code=HTML] <html> <head> <title>Round Corners</title> <style> *{margin:0} body{font:105% arial;text-align:center;padding-top:4em} h1{color:white;text-align:center;padding:10px 0 10px 0} .sm_box{margin:0 auto;width:50%} .sm_box .a,.sm_box .b,.sm_box .c,.sm_box .d{height:1px} .sm_box .a,.sm_box .b,.sm_box .c,.sm_box .d,.sm_box .content{background:#7fdcff;overflow:hidden;border:0 solid #7fdcff;border-width:0 1px} .sm_box .a{margin:0 5px;background:#7fdcff;border:0} .sm_box .b{margin:0 3px;border-width:0 2px} .sm_box .c{margin:0 2px} .sm_box …
The End.
Spaiz