-1
<?php 
include("lib/LIB_parse.php");
include("lib/LIB_http.php");
# Include parse library
# Include PHP/CURL library
$web_page = http_get($target="http://www.ethiojobs.net", $referer="");
$meta_tag_array = parse_array($web_page['FILE'], "<meta", ">");

var_dump($meta_tag_array);

for($xx=0; $xx<count($meta_tag_array); $xx++)
echo $meta_tag_array[$xx]."\n";
?>

When var_dump($meta_tag_array);

array (size=5)
  0 => string '<meta http-equiv="X-UA-Compatible" content="IE=edge" />' (length=55)
  1 => string '<meta name="keywords" content="Jobs, vacancies, Jobs in Ethiopia, Job search, recruitment in ethiopia, NGO jobs, heineken jobs, Finance Jobs, Marketing Jobs, Sales Jobs, Banking Jobs, Jobs in Addis Ababa, Jobs in Oromia, Jobs Ethiopia, IT Jobs, Management Jobs, Health care Jobs, Administrator Jobs, Accountant Jobs, Ethio jobs" />' (length=331)
  2 => string '<meta name="description" content="Find latest Jobs in Ethiopia, vacancies in Ethiopia on Ethiojobs. Apply now for Ethiopian NGO jobs, accounting and finance jobs and IT jobs. Recruitment in Ethiopia." />' (length=203)
  3 => string '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>' (length=68)
  4 => string '<meta name="google-site-verification" content="ZtExAGSQvU8_4awYUYXKnF9Zp5WWJBv_e8CSDVy7gXc" />' (length=94)
Cœur
  • 37,241
  • 25
  • 195
  • 267
Develop4Life
  • 7,581
  • 8
  • 58
  • 76
  • 2
    parse_array isn't a standard php function. we can't help you unless you show what it is. – Marc B Jul 29 '16 at 15:56
  • so... after all that. have you done any basic debugging? `var_dump($web_page)` to see what you got back. assuming this http_get is a pecl function, then it returns an array with **LOWER-CASE** array keys, not uppercase. – Marc B Jul 29 '16 at 16:02
  • yep i vardumo the meta_tag_array – Develop4Life Jul 29 '16 at 16:03
  • 1
    so your "array" ISN'T an array. it's a string. You really need to learn how to do basic debugging yourself. – Marc B Jul 29 '16 at 16:07
  • oh i see ? you know am following a book :( it says array5 zo – Develop4Life Jul 29 '16 at 16:09

1 Answers1

1
$web_page = "https://googel.com/";
    ^---string

$meta_tag_array = parse_array($web_page['FILE'], "<meta", ">");
                                    ^^^--array?

You can't use string keys on a string-as-array. That's just flat out not possible. And if you're trying to pass an array to this function, then passing a string is obviously not going to work EITHER.

php > $x = "some string";
php > echo $x['foo'];
PHP Warning:  Illegal string offset 'foo' in php shell code on line 1
Marc B
  • 356,200
  • 43
  • 426
  • 500
  • 1
    if you expect us to be able to help you with your problem, then post your **ACTUAL** code, and don't spread it out in comments. If we can't figure out what you're doing then you're NOT going to get any help. – Marc B Jul 29 '16 at 16:00
  • take a look the last result please – Develop4Life Jul 29 '16 at 16:07