Jump to content

etrader

Members
  • Posts

    315
  • Joined

  • Last visited

    Never

Everything posted by etrader

  1. Absolutely marvelous! exactly what I needed ... thanks a million!
  2. Since I get numbers and date from strings, they are in an ugly raw format as e.g. "14728293" and "2011-01-19". How to make the format stylish as "14,728,293" and "January 19, 2011"
  3. Thanks sasa, it works perfectly Definitely, I meant the first one, as the second one may lead to 5.5, which is indeed invalid. Thanks for your kind support
  4. I have a string for rating, containing numbers from 0-5. How I can assign an image to each range: 0-0.5 displaying 05.jpg 0.5-1.0 displaying 10.jpg . . . 4.5-5.0 displaying 50.jpg
  5. As far as I am testing, it is completely OK Thanks
  6. Thanks a million, it works perfectly
  7. The end of each url is a space; as a matter of fact, we should consider the phrase between http:// and the next (first) space
  8. Thanks, but this replaces only "http://". I want to delete the whole phrase (the url).
  9. I have a string containing long text. How can I remove links (in plain text, not hyperlink) starting with http://? In fact, I need a code to replace everything that is started with "http://" with "". Thanks
  10. Thanks for your kind assistance. My problem is that $url = $_SERVER['PHP_SELF']; considers the error page at "http://mysite.com/404.php" instead of the misspelled url. For example, if someone write "http://mysite.com/something-wrong.html", $url = $_SERVER['PHP_SELF']; echo $url; will show "http://mysite.com/404.php
  11. How can I write a 404 file to redirected any 'not found' page with structure of example.com/something/more/final.html to example.com/search?q=something+more+final Thanks
  12. I get this error Warning: file_get_contents(http%3A%2F%2Fsearch.yahooapis.com%2FWebSearchService%2FV1%2FrelatedSuggestion%3Fappid%3DYahooDemo%26query%3DMadonna%26results%3D2) [function.file-get-contents]: failed to open stream: No such file or directory in and this one Warning: implode() [function.implode]: Invalid arguments passed in
  13. With this link http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=YahooDemo&query=Madonna&results=2 , one can see suggested keywords for a query. The result is like "madonna 4 minutes madonna 4 minutes lyrics". How to put the resulting keywords in a $array, as can be used for further php coding. :-\
  14. Just out of curiosity; in the first version where the link is generated for each random word as <?php $titles_array = array("one","two","three","four","five","six","seven","eight","nine","word8","word3","word4","word9","anotherword","hello","funny","great","cool","nice"); shuffle($titles_array); $i = 0; foreach ($titles_array as $titles => $title) { $title = trim($title); $make_link = "http://example.com/$title"; $link = "<a href='$make_link'>$title</a>"; echo "$link<br />"; if (++$i == 5) break; } ?> we have the same CPU issue? I mean that php reads throughout the file to find a random word?
  15. I have a technical question: in the last code, we process the arrays in three foreach commands to process, then we randomly catch 5 of them and display. Imagine that the arrays are too long come from large txt files (e.g. 1GB). Does this overload the CPU usage?
  16. In Wordpress, the hyperlinked tags are displayed by <?php the_tags(); ?> I want to de-link the tags to show simple text (instead of link). I tried ereg_replace to replace hyperlink elements; strip_tags , but none of them worked.
  17. Yes, I already have what I wanted. You are a (challenging) php hero I hope others also benefit your talents! Thanks again!
  18. WOW! programming and coding is matter of tricky way of thinking. I doubt if I ever had this talent. Thanks a million!
  19. This is so kind of you. Actually, I made some efforts to modify the code. My problem was to use two 'foreach'. As you see, when we use foreach ($titles_array as $titles => $title) , we have the chance to use $title for making the url. But when using foreach ($links as $make_link) , the $title disappears and cannot be used for the link title. The problem is that we cannot have two variables, $links (as a mixture of initial variables: $domain, $tld, and $title) and $title for making the hyperlink.
  20. What do you think of considering long words (e.g. with more than 8 characters), then all common words like "of" "the" will be omitted. It is not perfect, but at least it works any idea?
  21. Sorry for many questions, but I really liked this amazing solution. In the case of <?php $titles_array = array("one","two","three","four","five","six","seven","eight","nine","word8","word3","word4","word9","anotherword","hello","funny","great","cool","nice"); shuffle($titles_array); $i = 0; foreach ($titles_array as $titles => $title) { $title = trim($title); $make_link = "http://example.com/$title"; $link = "<a href='$make_link'>$title</a>"; echo "$link<br />"; if (++$i == 5) break; } ?> How it is possible to define a list of urls too. I mean having an array file containing http://example1.com http://example2.com http://example3.com and make links randomly by the urls and words
  22. You are quite right fortnox007. I assumed to avoid such common words. Exactly, I mean keywords.
  23. I mean frequently repeated words. I consider SEO issues to capture tags.
×
×
  • 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.