php

What does this PHP syntax mean ?

Consider the code: $a = "foobar"; echo $a{3}; // prints b I know $a[3] is 'b' but how come using {} in place of [] produec the same result ? ...

PHP script to render a single transparent pixel (PNG or GIF)

I have to create a PHP that will return an image stream of one transparent dot (PNG or GIF) Could you point me to an easy to use solution ? Thanks a lot ...

find difference in 2 csv files. php

Sorry for my bad English. I must to check 2 csv files, if strings with one id is different, must write to file. If there is no string with id from 1st file in second file, must write this to file too. it works, but with element (id=47) i have got a trouble. it into to files, but script sad, that there is only in one. download script y...

Long waiting time between PHP and Oracle OCI

Hi ! I installed XAMPP on Windows server. There are 2 application on my server: First Application: PHP and MySQL application. This application runs quickly without and waiting time between links/pages. Second Appilcation: PHP and Oracle application. I use “Oracle Instant Client (OCI) for Windows (32 bit)” to connect Oracle Server (on ...

Sorting an array by a certain key

I have the following array: Array ( [Places] => Array ( [public] => 0 [entities] => Array ( ... ) ) [Issues] => Array ( [public] => 1 [entities] => Array ( ... ...

Jquery POST with same request not work

i have next problem $("#btnsave").click(function(){ $.post('svld.php',{'fnd':$('#fnd').attr("value")},function(data){ alert(data); },'json'); } slvd.php header('Content-type: application/json'); var_dump(json_encode($_POST)); in request i see next fnd http://ya.ru and have great response string(24) "{"fnd...

How to show all friend in friend list?

if an user login in his/her account then he will see all of his friends profile picture in his home page as like orkut, i have these tables fsb_friendlist containing: friendlist_memberid and friendlist_friendid fsb_profile containg: profile_userid, profile_name, profile_image, etc now how can i show user's friend in the home page? ...

Trying to display Vietnamese characters with php

When I try to display Vietnamese characters with the following code: <?php $str = "Nghệ thuật cắm hoa vải"; //echo utf8_encode(html_entity_decode(($str))); echo html_entity_decode($str); //echo $str; ?> I get Ngh�? thu�?t c??m hoa va?i as a result. Tried several option but couldn't make it. Any ideas? ...

how to download file from site (php)

withought ftp. from site to my hosting folder. how i can do that? ...

Generate alphanumeric employee ID

I would like to generate an alphanumeric employee id in PHP e.g. EP0001 Any ideas? ...

add arrays to associative aaray in php

<?php $tab=1;/*$_GET['tab'];*/ $id=1111;/*$_GET['id'];*/ include_once('solve.php'); $query="SELECT user_job.level1, user_job.tab_level, job.money_gain, job.exp_gain, job.energy_required, job.name,job.job_id FROM user_job RIGHT JOIN job USING(job_id) WHERE job.tab=".$tab." AND user_job.user_id=".$id." LIMIT 0,10"; $resu...

Need help deciding on a database scheme for a reporting project (PHP)

Update: I'm not looking for someone to come up with a schema for me. I guess I'm looking for input on whether some normalized DB design would work, when I can't clearly define all the relationships of the entities I'm working with, or if something more along the lines of a data warehouse would be something I wanted to ...

How can i calculate where the non transparent part of an image starts and ends with PHP?

Hi people, Here's a question: let's say we have a png image 200x200 that is transparent and there is a shape that starts at x,y (50,50) and has a width of 50px and height 20px. Is there any way with PHP (gdlib or imagemagick) that i could get the position of the shape relative to the image size? For the example given the script should ...

If the quantity increases the progress bar must increase using php

Hi, I need exactly like the below URL which lies under the BUY IT button. URL : http://www.buywithme.com/ When the no of purchase increases the progress bar will move step by step. I need to implement exactly with this functionality. Kindly refer me any idea or sample code. Thanks in advance ...

Drupal installation profiles

I'm new to drupal and I'm trying to understand installation profiles. Is an installation profile just a bunch of modules that you add to the main drupal release and glue together with some instructions for ease of future installation, or do they need to be custom tweaked before an installation profile could be made out of them? I noti...

How do I extract purticular line from Json stdclass array??

ok this is an Api call $json_string = '"offices": [{"description": "Google Headquarters", "address1": "1600 Amphitheatre Parkway", "address2": "", "zip_code": "", "city": "Mountain View", "state_code": "CA", "country_code": "USA", "latitude": 37.421972, "longitude...

Working with moodalbox in ajax

I am creating a Html content using ajax.In the call back functon i am displaying this on a div using document.getElementById('divid').innerHTML funtionIn that i have a url for displaying the whole comtent in a popup using moodalbox.in normal case the page is showing in a popup.But when i using ajax the content is not showing in popup. P...

Add child node to a specific index in an object with php

Hello everyone. I have an object, and I have a new value which I need to add to this object, but not just to the end of it, that would be no problem accomplishing. What I need to do is add this value to a new node on a specific index. Ok so here's the object. [object]=>{ ["a"]=> "value" ["b"]=> "value" ["c"]=> "value" ["d"]=...

locale aware string comparision

I´m using strcmp in combination with usort in order to sort an array of country names. Currently, the sort order is: Belgien Frankreich Italien Luxemburg Niederlande Spanien United Kingdom Österreich Which is correct, apart from the position of Österreich. It should be between Niederlande and Spanien. I also tried strnatcmp and strc...

how to cast bigint to prevent sql injection in php?

i am using php and running sql queries on a mysql server. in order to prevent sql injections, i am using mysql_real_escape_string. i am also using (int) for numbers casting, in the following manner: $desired_age = 12; $query = "select id from users where (age > ".(int)$desired_age.")"; $result = mysql_query($query); that work. But,...