Hello sir,
Using Curl Function in PhP, i got the source of a Web page .
In that I did not want the entire content, like some contents are all not needed so i have to eliminate those contents from the web page source and then remaining things only needed...
Is it possible in PhP by using Curl Function. If possible means how???
Please reply......
6 1500
Unless the page needs authentication you can just use file_get_contents.
I don't know of a direct way other than seperating the source as a string
[PHP]
$start = strpos($str, "start of string you want",) ;
$end = strpos($str, "end of string you want", $start) + strlen("end of string you want");
$length = $end - $start;
$wantedCode = substr($str, $start, $length);
[/PHP]
It's a little crude, but works.
I still wonder why you would have doubts about the cURL functions, seeing your thread title Doubts in PhP Curl Functions ? It gives you just what you asked! What you want to do with the result is your choice, but you cannot blame cURL for that.
Ronald :cool:
I still wonder why you would have doubts about the cURL functions, seeing your thread title Doubts in PhP Curl Functions ? It gives you just what you asked! What you want to do with the result is your choice, but you cannot blame cURL for that.
Ronald :cool:
Sir,
I asked for that query is because of,
i did the program using Curl Function to get the page which is returned by google for any search string....... I want to show the resulted contents only... Not google related things means, In google search results displayed in window with the Sponsored links, Bottom having Navigation bar containing Paging No's and then Top having search Text box and etc., So these are all not needed for me..... Only the results of Search String only needed......
So for that only i asked that query, is it possible in Curl function to obtain specific contents from the entire source.
Plese reply me......
cURL is used for getting the entire response, cURL cannot give you any more or any less, except a success/fail reading, but from that mass of information you can use PHP to take the parts you want.
cURL is used for getting the entire response, cURL cannot give you any more or any less, except a success/fail reading, but from that mass of information you can use PHP to take the parts you want.
Ok thanks sir,
I need another help from you sir, If i using preg_match to match for particular pattern in the string, It returns whether it is present or not..... But i want to get the Position of Occurrence of that pattern in that string.. Is it possible means tell me asap
You opened a new thread for this last question, so now you start double posting!!
This thread will be closed.
Ronald :cool:
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: GluedToTheScreen |
last post by:
I have a small PHP ecommerce site set up using Authorize.net's SIM (simple)
interface. Working fine, but... I'd like to implement their AIM interface
(so visitor's will never see the gateway's...
|
by: Phil Powell |
last post by:
What is the most standardized method of utilizing the CURL functions
in PHP (version 4.3.2) to be able to retrieve the contents of a remote
URL that happens to be dependent upon $_SESSION for its...
|
by: James |
last post by:
Hi guys,
I have been building a search engine here - not because I have plans of
dethrowning Google but as a simple app upon which to develop a function
set that I can use for other things.
...
|
by: lawrence k |
last post by:
I'm reading over this page:
http://www.php.net/manual/en/ref.curl.php
What I'm missing is why? What problem does curl solve? What does it
make easier? When would I use its functions, instead...
|
by: sundar22in |
last post by:
Hi,
How to use CUrl??? What are the libraries to be included using the
require_once command??
I wanted to implement Range Header and get a part of file thru HTTP. So
found that curl_setopt()...
|
by: h.stroph |
last post by:
Greetings,
I apologize for my lack of literacy with php, but am wondering if someone
will tell me how to use the curl php functions to navigate to the page that
results from entering the login...
|
by: kvijayhari |
last post by:
hi
I've decided to use curl() to fetch the links from a website page from my server.
If the page any harmful executable files, will my server execute that when i'm using the curl() function?...
|
by: jeddiki |
last post by:
Hi,
I am modifying a ipn script for my use and want to fully understand what it is doing. It seems to me that it is trying to do a cUrl and if that fails it uses a fsockopen function.
Here are...
|
by: jeddiki |
last post by:
I am using curl to down load a zip file and I am
then trying to unzip it, but I don't think that I am
using the functions properly because I get warnings
This is my code:
<?php
if...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |