Php Buddies,

Why do you reckon the following script is unable to replace the 'https://' or the 'http://' words with '' ?
It is able to replace the words 'www.' with '', though.

Open 2 tabs in your browser where one opens to the page where you are running the following script in your wamp/xampp and the other tab should open direct to [url][/url] for your experiment.

Running the script in your wamp/xampp and hovering your mouse over "fashion" link on ebay would show you 'http//' and that is proof 'www.' got replaced.
You may confirm this cross checking both tabs by hovering your mouse over the mentioned links.
Now, in the (non xampp/wamp) tab, hover your mouse over the links "register", "sign in", etc. and you will see they start with 'https://'. Then finally, in the other tab (xampp/wamp), hover your mouse over these same links and you'd see the 'https://' have not been replaced with ''.
Why is that ?
Why is the str_replace failing on these 2 occasions to replace the 'http://' and the 'https://' to '' ?

Recommended Answers

All 2 Replies


I've fixed the code but with a little hiccup. Took me 2hrs to fix it! Will try ridding the hiccup after I wake-up and then reveal the fix. In the meanwhile, it's my bed time. No good working now and make mistakes with a sleepy head. Stay tuned, my friend. Let's see what brings the next night! ...
You will see how innovative I can become in a very tight corner.
Thanks for all your helpS so far!
You won't regret it! Here's my challenge to myself ...
The final code would be a life saver for the world!

And, don't forget:

Infact, my same threads used to be on 10 forums. But some were unresponsive or hardly any members and so dropped to 6. Then to 4. Now to about 3.
And so, rprofitt, it's no big deal about the link you're showing. You only managed to pull up 1 link and I revealed another 1. That remains 2 more to go. Look for the other 2. (We are playing hide and seek, aren't we ?).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.