-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello, I have this snippet
while($row = mysql_fetch_array($result)){
$search = '' . $row['searchquery'];
echo '<a href="http://www.example.com/' . preg_replace( array('/[^\s\w]/','/\s/'),array('','+'),$search) . '+/">' ...
but if someone types in äöü, it doesnt show the letters - with rawurlencode…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I found a function online for turning a url within a string into a clickable link. However, when the url contains a hashtag it doesn't work. eg. http://www.bbc.co.uk/radio1/photos/fearnecotton/5759/1#gallery5759
Here's the part of the function concerned:
$ret = preg_replace(
"#(^|[\n ])([\w]+…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm in the process of updating some old CSS files in our systems, and we have a bunch that have lots of empty classes simply taking up space in the file. I'd love to learn how to write Regular expressions, but I just don't get them. I'm hoping the more I expose myself to them (with a little more cohesive…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I need to convert a string of text containing a long url into the same string but with a tinyurl (using the tinyurl api). eg. convert "blah blah blah /http://example.com/news/sport blah blah blah" into "blah blah blah http://tinyurl.com/yaeocnv blah blah blah".
How can it be done? PLEASE NOTE I added…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Welcome,
I notice that Youtube make some changes into their website code.
Anyone have idea how make it working today ?
That's my script (don't work anymore)
preg_match('/"video_id": "(.*?)"/', $page, $match);
$var_id = $match[1];
preg_match('/"t": "(.*?)"/', $page, $match);
$var_t = $match[1];
Look…
>>> More