
joshis
Members-
Posts
18 -
Joined
-
Last visited
Never
Everything posted by joshis
-
Hello, I have a simple htaccess issue. In my localhost I have a folder mysite. mysite has three subfolders. 1. html 2. dev 3. images I have put my htaccess in mysite folder. My rule is if anyone access site through http://localhost/mysite it should read files from html folder. My current htaccess is follows RewriteBase / RewriteEngine on RewriteCond $1 !^(index\.php|images|css|dev|js|robots\.txt) RewriteRule ^(.*)$ html/index.html$1 [L] -Arun That is http://localhost/mysite/aboutus.html should show files in http://localhost/mysite/html/aboutus.html -Arun
-
Hi, I have a html string. In that I defined some area for editing. That area enclosed in certain comment. I want to get all the content between that comment. For example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>My title</title> <!--text--> </head> <body> <!--start editable content--> <div class="container1"> some html with <b>bold</b> string </div><!--End Container--> <!--end editable content--> </body> </html> In the above example I need <div class="container1"> some html with <b>bold</b> string </div><!--End Container--> -Thanks Arun
-
Wow, Its worked. 1000000000 Thanks Jay... -Arun
-
Hellom I have a text string. That may or maynot contain email addresses. I want to replace all . (fullstop) to dot. I mean to Can I do with regex rules? -Thanks
-
Hi, I need some help about .htaccess file. I want to redirect http://www.yourdomain.com to http://yourdomain.com. how to do this? I have a code, can anyone correct it? RewriteEngine On RewriteCond $1 !^(index\.php|images|css|js|uploads|ckeditor|photos|albums|books|robots\.txt) RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com$ [NC] RewriteRule (.*) http://yourdomain.com/$1 [R=301,L] I am developing the site using codeigniter Thanks Arun
-
Need Regular Expression help Hi, I want to remove all string stating with "<p class='fb-like'><iframe" and ending with "</iframe></p>" from a long html string. It may contain more than one such expressions. Any help is greatly appretiated. Thanks Arun
-
Thanks for your help. I have small tweek as you mensioned on last post, Itried last one but it doesn't work for me. For every link text it appends three dots (...) regardless of the total no of chars. For example <a href="http://site.com">site</a> it returns a href="http://site.com">site...</a> it should be <a href="http://site.com">site</a> Only for link texts with length more than 30 i require ... Any help is greatly appreatiated.
-
Thanks Crayon Violent, Its working fine.
-
I have a html string that contain 'many' links like I want this link to be replaced with that is link text is shrink to limited no (30) chars. I am not good at regx. Can any one please help?
-
I would like to get strings within the '{}' symbols. My expression is like this. but it gives result as but I need Can anyone help me?
-
I used your code like this.. <? $input = <<<END some content <img src="image1.jpg" alt="" width="100" height="150" /> some content. <div><img src="image2.jpg" alt="" width="100" height="150" /></div> some content <img src="image3.jpg" alt="" width="100" height="150" /> some content..<div><a href="#"><img src="image4.jpg" alt="" width="100" height="150" /></a></div> some content END; //preg_match_all("#<img[^>]>#i", $input, $out); preg_match_all("#<img[^>]*>#i", $input, $out); var_dump($out); ?> Sorry If am wrong. It finds all the images...
-
My actual requirement is, My html contains many img tags. Some are inline and some are enclosed in a div or anchor tag. So my inline images are scattered in the page regardless of the style and size. So I would like to enclose these tags in a <div><a> wrap to style it. Thats why I need this pattern.
-
sorry cags, it is not working...
-
I have some html content. I would like to find all the 'inline' images in the content. I dont need to find the images with in any other tags like anchor or div. eg: some content <img src="image1.jpg" alt="" width="100" height="150" /> some content. <div><img src="image2.jpg" alt="" width="100" height="150" /></div> some content <img src="image3.jpg" alt="" width="100" height="150" /> some content..<div><a href="#"><img src="image4.jpg" alt="" width="100" height="150" /></a></div> some content I want to find img tags <img src="image1.jpg" alt="" width="100" height="150" /> and <img src="image3.jpg" alt="" width="100" height="150" /> because they have no outer tags.
-
Thaks Daniel. It works....
-
Hi, How can I remove the height attribute from my img tag? Source string: I need the above content like this.
-
Sorry my steps mislead you, please ignore steps 4 and 5. The anchor and div tag should be there, around the img. We need to modify only the img tag, as example.
-
Hi, I would like to replace the img tags in my entire html string as the following way. 1. detect all img tags 2. if it has a height attribute, replace with my new value. 3. if it has a width attribute, replace with my new value. 4. add a link wraper for the new img tag 5. also add a div wraper to the new <a><img /> </a> element. My goal is to change all the large images to thumburl. Actually all the large images are surrounded by a anchor tag. I like to add that href to the new thumbnail link eg: <div class='thumb-wrap'><a href='mypage.php?id=4'><img width='500' height='200' src='image.jpg' /></a></div> to <div class='thumb-wrap'><a href='mypage.php?id=4'><img width='100' height='50' src='image.jpg' /></a></div> Can I write this using regex expression?