Re: [PHP] String conversion function

2003-07-09 Thread Pascal Polleunus
Simon Fredriksson wrote: I'm wondering if there's any easy way to convert special chars to the numerical version of it. Like space converts to %20 and slash (/) to %2F. rawurlencode is what you're looking for -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.p

[PHP] String conversion function

2003-07-09 Thread Simon Fredriksson
I'm wondering if there's any easy way to convert special chars to the numerical version of it. Like space converts to %20 and slash (/) to %2F. //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] string conversion

2001-09-20 Thread Jason G.
Sorry, In this case, use explode() instead of split() ... Andras, $aRay = split('.', 'mypicture.jpg'); $aRay[0] will be the filename $aRay[1] will be the extension -Jason Garber www.deltacron.com At 03:14 PM 9/20/2001 -0700, Andras Kende wrote: >Hi, > >I trying to cut the last 4 char of a s

Re: [PHP] string conversion

2001-09-20 Thread Philip Olson
hi andras- consider the strstr() and strrstr() functions : $str = 'abcabc'; print strpos ($str,'b'); // 1 print strrpos($str,'b'); // 4 these positions can be used with other functions, such as substr() : $str = 'abc.png'; print strpos($str,'.');// 3 print

Re: [PHP] string conversion

2001-09-20 Thread Jason G.
Andras, $aRay = split('.', 'mypicture.jpg'); $aRay[0] will be the filename $aRay[1] will be the extension -Jason Garber www.deltacron.com At 03:14 PM 9/20/2001 -0700, Andras Kende wrote: >Hi, > >I trying to cut the last 4 char of a string but sometimes its cut 3 sometime >4 char > >$pic1

[PHP] string conversion

2001-09-20 Thread Andras Kende
Hi, I trying to cut the last 4 char of a string but sometimes its cut 3 sometime 4 char $pic1=$amyrow["picture"]; $pic2 = substr("$pic1", 0, -4); Actually I have some pictures where I need to cut off the extensions... amamm.jpg 33.jpg 321.gif to amamm 33 321 Is any other way than substr