[PHP-DB] String manipulation
Hi there everyone, I'm working with a mysql Db where I have a single string that I have to split into 2 strings, the first character is the first name and I have that split off into it's own variable, but what I need to know is what's the best method to read the string again BUT ignore the first letter as that is already copied into $firstname? So basically I have $firstname defined from the one string, but I have to define $lastname from the SAME string value as the one I used for $firstname, BUT ignoring the first letter but I'm not sure what the best method is to achieve this? Any help would be very appreciated. Chris
[PHP-DB] String manipulation
How would I put a space after each letter: echo str_shuffle(stripslashes(mysql_result($word_result,0,"word")); Ron
[PHP-DB] string manipulation
Hello everyone, this is my first post, so please bare with me. I am very new to php and i am currently working on modifying existing php e-commerce site. so my question is as follow and its more of a general question but it involves a db so i thought i would ask here i have a mysql db, in one of the fields, there is a description of an item, along with a url all in one field. what i need to do is to extract the url string from the description field. is there some sort of parsing call i can evoke to extract the url? Beginning with the http and ending with the first white space? Martin _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] String manipulation
Are you trying to achieve this in the db or for the application? It sounds like the application, in which case I would get the string from the db and then use substr to pull out the various elements. $first_name = substr($rows['name'],0,1); $last_name = substr($rows['name'],1); Bastien From: "Chris Payne" <[EMAIL PROTECTED]> To: Subject: [PHP-DB] String manipulation Date: Mon, 2 May 2005 00:48:58 -0400 Hi there everyone, I'm working with a mysql Db where I have a single string that I have to split into 2 strings, the first character is the first name and I have that split off into it's own variable, but what I need to know is what's the best method to read the string again BUT ignore the first letter as that is already copied into $firstname? So basically I have $firstname defined from the one string, but I have to define $lastname from the SAME string value as the one I used for $firstname, BUT ignoring the first letter but I'm not sure what the best method is to achieve this? Any help would be very appreciated. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] String manipulation
Ron Piggott wrote: How would I put a space after each letter: echo str_shuffle(stripslashes(mysql_result($word_result,0,"word")); Ron CSS best handles styling E.G. OR $word_result"; ?> Increase the em value to customize the spacing Louise -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] String manipulation
You can do like this: $str = 'helloworld'; echo preg_replace('//', ' ', $str); this will print out -> h e l l o w o r l d Olavi Ivask > How would I put a space after each letter: > > echo str_shuffle(stripslashes(mysql_result($word_result,0,"word")); > > Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php