Jump to content

ghostwalkz

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ghostwalkz's Achievements

Member

Member (2/5)

0

Reputation

  1. Now thats what I am talking about!!! TY!!! Fixed!
  2. Hi all, I need to extract every second word in a string: eg: $foo = "one two three four five six" I need $bar to only consist of every other word like this: $bar = "one three five" How might I do this, also any code examples would be much appreciated.
  3. That almost works, but.. if my string has 2 periods eg: $string = "somestuff.morestuff,finalstuff"; You solution only returns 'morestuff' whereas I need 'morestuff.finalstuff' If that makes any sense? Thanks for the help BTW! ;-)
  4. I have a string: $string = "somestuffthatchanges.somemorestuffthatchanges"; How can I strip everything before the first occurence of the period so it leaves me with just 'somemorestuffthatchanges'?
  5. Okay I am stuck. I have a string that can change it's a domain name: $string = "http://www.w3.org"; or it could be $string = "http://lists.w3.org"; or even $string = "http://docs.google.com"; so what I need to do in PHP is extract the domain (w3.org or google.com or whatever) from the string. Maybe something to do with grabbing the two words either side of the last dot or something, but I am stuck. Any help appreciated. - Code example even better!! ;-)
  6. Perfect, works great (no escape ness), thankyou, thanks, gracias, muchos gracias, etc etc.
  7. thats it, anything outside the youtube tag is random and can change. The constant is the tag. I need to extract whats in that tag. Thanks in advance. :-)
  8. Hi all, I have a string: $foo = "blahblahblahrandomstuff {youtube}imdKQ3NNnoM{/youtube} moreblahblahblahrandomstuff"; I need to extract the 'imdKQ3NNnoM' from inside the {youtube} tags. Any ideas - a code example would be muchly appreciated.
  9. Nope Sasa, I can't get this to work, thanks for your efforts, any more ideas?
  10. Hi all, It will be better to show you what I mean. Below is the 'string' (for example). We'll call it '$string1' What I want to do is Base64 encode everything between the href=" and the following quote (ie the url), not just once but throughout '$string1' Any Ideas? An exact code snippet would really be appreciated! snip-------- <link rel="shortcut icon" href="/cms/images/favicon.ico" /> <link href="/cms/templates/rt_versatility4_j15/css/template_css.css" rel="stylesheet" type="text/css" /> <link href="/cms/templates/rt_versatility4_j15/css/menustyle4.css" rel="stylesheet" type="text/css" /> <link href="/cms/templates/rt_versatility4_j15/css/style2.css" rel="stylesheet" type="text/css" /> <link href="/cms/templates/rt_versatility4_j15/css/typography.css" rel="stylesheet" type="text/css" /> <link href="/cms/templates/system/css/system.css" rel="stylesheet" type="text/css" /> <link href="/cms/templates/system/css/general.css" rel="stylesheet" type="text/css" /> <link href="/cms/templates/rt_versatility4_j15/css/rokslidestrip.css" rel="stylesheet" type="text/css" /> <link href="/cms/templates/rt_versatility4_j15/css/rokmoomenu.css" rel="stylesheet" type="text/css" /> unsnip--------
  11. The above code basically is supposed to allow those characters in a username. BUT... things like & (even tho it seems to be present in the above ereg, and pipe, along with curly brackets () and others still fail, how can I modify that ereg to allow all characters as a username. ;-)
  12. Hi All, Got a bit of a problem, heres the code: -----snip if (ereg('^[A-Za-z0-9!#$%&()+/£-.:;@\^_{}~]*$', $this->username) || strlen(utf8_decode($this->username )) < 2) { $this->setError( JText::sprintf( 'VALID_AZ09', JText::_( 'Username' ), 2 ) ); return false; } -----unsnip How can I get symbols like () or <> or | (pipe) inside that ereg, they are special characters how do I escape them so that I can use them in a username? Thanks in advance!
  13. Hi guys, I have an array with various values. Now I can print a particular value to screen using: print_r($data[$server_id]['hostname']); which returns the hostname value inside the array. Perfect. BUT..... How can I turn that value into a string. I have tried $hostname = print_r($data[$server_id]['hostname']); but it doesn't work. Help would be greatly appreciated.
×
×
  • Create New...

Important Information

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.