Jump to content

gdfhghjdfghgfhf

Members
  • Posts

    218
  • Joined

  • Last visited

Everything posted by gdfhghjdfghgfhf

  1. Have you even tried this script i put together for you? It does exactly what you want. -cb- i have a problem with this script for example, this text: will turn into: i want to convert only the links that start with http:// but the script thinks the list of the mp3 names are links any help would be appreciated!
  2. i want to shorten only the big words, not to shorten a whole string example: "this is a text with small words and a big word like " anticonstitutionally " and i want to shorten words that exceed 10 characters" would result in "this is a text with small words and a big word like " anticonsti" and i want to shorten words that exceed 10 characters"
  3. is there a function in php that could shorten the words if the words exceed 15 characters ?? thanks
  4. yes you are right... i just realized the given example will work but if i try with this text it will not work: i don't understand where the problem comes from.. actually, i want to replace ALL links with the text "link" so something like http://www.awebsite.com/hello/blabla/hi.php would be replaced by "link"
  5. hello, i am using this script to remove links in a text: the problem is that it will also remove the first word after the link example: would result in: how can i fix this ? also, i would like to replace the links with the word "(link)" instead of just removing everything thanks a lot!
  6. ok so here is my situation: i have a t-shirt shop at spreadshirt.com, but it is in french i'm trying to translate the main page in english so i use file_get_contents() to display the page, and then i use str_replace() to translate the words i can translate all the words but when i try to replace a word with accents it doesn't work... how to solve this problem ?
  7. Well i'm looking to do something i usually could do easily using COUNT and GROUP BY if it was a sql query... But this time i'm working with an array... so i have an array that looks like this $array( "dog", "cat", "dog", "fish", "horse", "cat", ); First i want to group together the duplicate entries. And then, i want to list the number of times the item was found in the array with the above example, i would be expecting a result like this: $array( "dog (2 results)", "cat (2 results)", "fish (1 results)", "horse (1 results)", ); From what i have read on google i can group together the duplicate entry with array_unique() but i have no idea how i can list the number of times this item was found in the array thanks for helping me!!
  8. Damn, sorry here is the query with the GROUP BY request So it will group together entries with the same name, but it will lose its original position ! (i.e. first entries will not be first anymore once its grouped)
  9. i usually use this query to display the last 10 entries from a sql table: $query = "SELECT search_time, search_keywords FROM phpbb_popsearch ORDER BY search_time DESC limit 35"; as you can see it will order the results by "search_time" so the latest entries are listed first normally the result would be something like this: but now i just want to include a "GROUP BY" in this sql request $query = "SELECT search_time, search_keywords FROM phpbb_popsearch ORDER BY search_time DESC limit 35"; but with the GROUP BY my sql query isn't ordered correctly anymore. the result would be something like this: notice the "duplicate" entry was grouped together, but it's not in the second first position anymore ??? i was expecting a result like this: Since entry called "duplicate" is the second last added entry.... i hope you understand what i mean ^^ thanks for help
  10. ok so i have this very simple code: $query = "SELECT search_keywords, COUNT(search_keywords) AS counter FROM phpbb_popsearch GROUP BY search_keywords ORDER BY counter DESC limit 5"; $res = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($res)) { $term = $row["search_keywords"]; echo $term; } phpbb_popsearch is a table where i put the last search terms used in my forum search engine this code will group together the same terms and list the 5 most popular terms my problem is that the results will be ordered by "counter" which is the number of time a term has been found. I want to get the 5 most popular results AND THEN, AFTER, list the results alphabetically if i sort the results alphabetically right in the sql query (replacing "ORDER BY counter" by "ORDER BY search_keywords") it will not work correctly because it will not get the 5 most popular terms but just the 5 first terms, alphabetically sorting them and ignoring the number of times the term has been found thanks for help !!
  11. Yeah but to me W3C was a source as serious as the php manual, but oh well... But if old browsers are still limited to 100 chars then my script wont be compatible with old browsers??
  12. damn.... actually i didnt try it because i found a lot of pages saying it is limited to 100 chars on google.... like this page (first result in google when i type $_GET) http://www.w3schools.com/PHP/php_get.asp "Note: The get method is not suitable for large variable values; the value cannot exceed 100 characters." ill try it now!
  13. here's an example: file.php <?php $url = $_GET("url"); echo "<meta http-equiv=\"refresh\" content=\"1; URL=$url\">"; ?> now if i access "file.php?url=http://blabla.com" using a url longer than 100 characters it won't work
  14. i think you didn't understand what i want to do i want to make a script that i can access just like anonym.to and if i access this URL, then it will display some text and redirect 5 seconds after my only problem is that i can't use $_GET because the limit is 100 characters
  15. Ok basically what i want to do it a redirection system with a temporary page..... just like anonym.to if you go to http://anonym.to/http://www.phpfreaks.com it will display a temporary page then redirect you to phpfreaks.com normally i would just do that with $_get but the damn limit of characters is only 100, so it will not work with long URL how exactly is anonym.to working ? It looks like a htaccess redirect, but how can you transmit values through htaccess then take back this value in your php code just like $_GET does any suggestions? btw i want to avoid using $_POST if possible...
  16. I'm not sure what you mean.... how can i add that lazy quantifier ?
  17. unless i am doing something wrong, this is not working
  18. i have one more problem this code will not replace links with single quote, like this:
  19. Damn, i'm an idiot! I didn,t pay attention to the space. Thanks a lot Oh and how about stop converting <a href=""></a> to would it be very hard??
  20. actually, here is my real input (with the problematic images): http://www.punksandskins.com/crawler1.php it is a rss feed, i'm trying to take the html content with file_get_contents, then convert the html to bbcode with the code i posted above
  21. i thought i had to.... does it really change something ? this html code: <br /><br /><img src="http://i120.photobucket.com/albums/o180/seeeingred/1422573.jpg"><img src="http://i120.photobucket.com/albums/o180/seeeingred/untitled-6.jpg"><br /> returns this: [img]http://i120.photobucket.com/albums/o180/seeeingred/1422573.jpg">****REAL IMAGE HERE***
×
×
  • 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.