Find Jobs
Hire Freelancers

PHP Text Processing

$30-90 USD

Closed
Posted over 17 years ago

$30-90 USD

Paid on delivery
I want the a good compact and fast PHP function to display to the browser, any text that user insert it to my site: function TextProcessing($text, $color= array(), $wrap = 0, $url = 0, $br = 0){ // first of all, convert html special chars, using for example htmlspecialchars() // $color uses when user search for some text if(count($color)) // then color array's item with red // $wrap is any number if($wrap) // then apply something like: $text = wordwrap($text, $wrap, "<wbr />", 1); // $url 0 or 1 if($url) // then convert http/https/ftp text url to html url // $br 0 or 1 if($br) // then apply something like: $text = nl2br($text); return $text } Try this example: $text = ' tex t <[login to view URL]> and te xt (<[login to view URL]>;) and **abce 5>4 "sdf" < text <ftp://[login to view URL]>{ and** ** one more <[login to view URL]> end <[login to view URL]> ';** **echo TextProcessing($text, array("and ab","com","&","5>","\""), 40, 1, 1);** **So, in this example, all urls must be converted to clickable urls. All words longer than 40 chars, including urls, must be wrapped. The items ("and ab","com","&","5>","\"") must be colored by red,... Good luck.** ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). 4) Make sure the function is working fine with this example: $vText = ' tex t <[login to view URL]> and te xt (<[login to view URL]>;) and 5>4 "sdf" text [rul[login to view URL](that is it):[ and <br> text [ftp://[login to view URL]{ and </div> one more <[login to view URL]> end <[login to view URL]> hi.... <[login to view URL]> ThereIsNoSpaceBetweenThisLineAndTheLineAboveItIsOnlyNewLineAndThisLine<font color=\'red\'>khalid</font>IsLongLineThereIsNoSpaceBetweenThisLineAndTheLineAboveItIsOnlyNewLineAndThisLin<b>0000</b>eIsLongLineThereIsNoSpaceBetweenThisLineAndTheLineAboveItIsOnlyNewLineAndThisLineIsLongLine the End. .. '; //$vWrap=40; echo "<html><head><title>Text</title></head><body>"; echo funText($vText, array("text","com","&","5>","<br>"), 40, 1, 1); echo "</body></html>"; * * *This broadcast message was sent to all bidders on Sunday Jan 14, 2007 1:00:51 PM: I add this to my bid: 4) Make sure the function is working fine with this example: $vText = ' tex t [login to view URL] and te xt ([login to view URL];) and 5>4 "sdf" text [rul[login to view URL](that is it):[ and text [ftp://[login to view URL]{ and one more [login to view URL] end [login to view URL] hi.... [login to view URL] ThereIsNoSpaceBetweenThisLineAndTheLineAboveItIsOnlyNewLineAndThisLinekhalidIsLongLineThereIsNoSpaceBetweenThisLineAndTheLineAboveItIsOnlyNewLineAndThisLin**0000**eIsLongLineThereIsNoSpaceBetweenThisLineAndTheLineAboveItIsOnlyNewLineAndThisLineIsLongLine the End. .. '; //$vWrap=40; echo ""; echo funText($vText, array("text","com","&","5>"," "), 40, 1, 1); echo ""; ## Platform Linux Apache2 PHP5
Project ID: 2805344

About the project

8 proposals
Remote project
Active 17 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
8 freelancers are bidding on average $44 USD for this job
User Avatar
See private message.
$42.50 USD in 5 days
5.0 (81 reviews)
5.9
5.9
User Avatar
See private message.
$42.50 USD in 5 days
4.9 (84 reviews)
5.3
5.3
User Avatar
See private message.
$38.25 USD in 5 days
4.8 (124 reviews)
5.3
5.3
User Avatar
See private message.
$42.50 USD in 5 days
4.9 (12 reviews)
4.5
4.5
User Avatar
See private message.
$52.70 USD in 5 days
4.7 (42 reviews)
4.7
4.7
User Avatar
See private message.
$68 USD in 5 days
4.3 (9 reviews)
3.0
3.0
User Avatar
See private message.
$42.50 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$25.50 USD in 5 days
0.0 (1 review)
0.0
0.0

About the client

Flag of SAUDI ARABIA
Saudi Arabia
0.0
0
Member since Jan 13, 2007

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.