etrader
-
Posts
315 -
Joined
-
Last visited
Never
Posts posted by etrader
-
-
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"
-
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
-
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
-
As far as I am testing, it is completely OK Thanks
-
Thanks a million, it works perfectly
-
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
-
Thanks, but this replaces only "http://". I want to delete the whole phrase (the url).
-
-
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
-
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
-
Thanks! It works perfectly
-
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
-
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.
:-\
-
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?
-
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?
-
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.
-
Yes, I already have what I wanted. You are a (challenging) php hero
I hope others also benefit your talents!
Thanks again!
-
WOW! programming and coding is matter of tricky way of thinking. I doubt if I ever had this talent.
Thanks a million!
-
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.
-
Many thanks for your useful help!
-
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?
-
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
and make links randomly by the urls and words
-
i am prettyy sure you don't mean frequently repeated words. But keywords
otherwise you end-up with words like: " I are is we do etc "
You are quite right fortnox007. I assumed to avoid such common words. Exactly, I mean keywords.
-
What do you mean by the "main words of the text"?
I mean frequently repeated words. I consider SEO issues to capture tags.
modifying the format of date and numbers
in PHP Coding Help
Posted
Absolutely marvelous! exactly what I needed ... thanks a million!