| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Dec 2006
Posts: 236
![]() | PHP - Replacing blanks with + Hi everyone, How can I replace the blanks with + in red variable? Code: class RSSParser {
var $insideitem = false;
var $tag = "";
var $title = "";
var $description = "";
var $link = "";
function startElement($parser, $tagName, $attrs) {
if ($this->insideitem) {
$this->tag = $tagName;
} elseif ($tagName == "ITEM") {
$this->insideitem = true;
}
}
function endElement($parser, $tagName) {
if ($tagName == "ITEM") {
print "
<b>" . $this->title . "</b>
<div class=\"text\">" . $this->description . "<br /><a href=\"" . $this->title . "\" target=\"_blank\"></a></div><br />"; |
| | |
| | #2 (permalink) |
| NamePros Member Join Date: Nov 2003 Location: Ontario, Canada
Posts: 127
![]() ![]() | str_replace(" ","+",$this->title) ---------- Post added at 12:52 AM ---------- Previous post was at 12:50 AM ---------- Personally, if you are trying to parse an RSS feed, I would just SimpleXML. If you need help, PM me. |
| | |
| | #4 (permalink) |
| Tech Support Join Date: Mar 2005
Posts: 4,944
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I would recommend using urlencode($this->title) - it will make sure that other characters are also url friendly (other than space -> +) |
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Your thoughts on "z" replacing "s" in domain names? | Phare | Domain Name Discussion | 13 | 04-25-2010 02:29 PM |
| Domainer by day a---- by night (fill in the blanks) | sirengirl | The Break Room | 34 | 04-14-2010 02:22 PM |
| Fill in the blanks: "Because of the sale of (name) for $(amount), I got (name) | Domainate.com | Domain Name Discussion | 4 | 04-25-2006 05:37 AM |
| Replacing 'S' with 'Z' | Mattias | Domain Newbies | 6 | 04-23-2006 07:30 AM |